Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

success and failure callback functions js

const {checkInventory} = require('./library.js');

const order = [['sunglasses', 1], ['bags', 2]];

// Write your code below:
const handleSuccess = (resolvedValue) => {
  console.log(resolvedValue);
}

const handleFailure = (rejectedReason) => {
  console.log(rejectedReason);
}

checkInventory(order).then(handleSuccess, handleFailure);
 
PREVIOUS NEXT
Tagged: #success #failure #callback #functions #js
ADD COMMENT
Topic
Name
8+8 =