The conversation between human and AI assistant.
What's the difference between a promise and a callback in Javascript?
Can you give an example of using promises and callbacks?
Sure. Here's an example of using a callback for a file read operation:

```
fs.readFile('path/to/file', function(err, data) {
  if (err) {
    console.error(err);
  } else {
    console.log(data);
  }
});
```

And here's an example of using a promise for the same operation:

```
const fs = require('fs').promises;

fs.readFile('path/to/file')
  .then(data => console.log(data))
  .catch(err => console.error(err));
```