kzelda's notebooks

  • Untitled - /kzelda/axios-oued
    Last edited 5 years ago
    const axios = require('axios'); console.log("Faycel is here :)"); // Make a request for a user with a given ID axios.get('https://www.ouedkniss.com/telephones/smartphones') .then(function (response) { // handle success console.log(response.data); }) .catch(function (error) { // handle error console.log(error); }) .finally(function () { console.log("finished"); });
  • Untitled - /kzelda/immutable-equals-is
    Last edited 5 years ago
    const { Map, is } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3 }); const map2 = Map({ a: 1, b: 2, c: 3 }); console.log(`map1 !== map2 => ${map1 !== map2}`); // two different instances are not reference-equal console.log(`map1.equals(map2) => ${map1.equals(map2)}`); // but are value-equal if they have the same values console.log(`is(map1, map2) => ${is(map1, map2)}`); // alternatively can use the is() function