success and failure callback functions js

Solutions on MaxInterview for success and failure callback functions js by the best coders in the world

showing results for - "success and failure callback functions js"
Amanda
02 Aug 2017
1const {checkInventory} = require('./library.js');
2
3const order = [['sunglasses', 1], ['bags', 2]];
4
5// Write your code below:
6const handleSuccess = (resolvedValue) => {
7  console.log(resolvedValue);
8}
9
10const handleFailure = (rejectedReason) => {
11  console.log(rejectedReason);
12}
13
14checkInventory(order).then(handleSuccess, handleFailure);