In functional programming you often want to apply a function partly. A simple example is a function add.
It would be nice if we could use add like:
var res2 = add(1, 3); // => 4
var add10To = add(10);
var res = add10To(5); // => 15
| const options = { | |
| guards: { | |
| isValidElement: () => true | |
| } | |
| } | |
| Machine({ | |
| id: 'canvas', | |
| initial: 'pendingInstance', | |
| context: { |
| Toggle Component | |
| Active | |
| TOGGLE -> Inactive | |
| Inactive | |
| TOGGLE -> Active | |
| https://www.kabum.com.br/cgi-local/site/produtos/descricao_ofertas.cgi?codigo=69279&gclid=CjwKCAjwk6P2BRAIEiwAfVJ0rDGJzGiihd4AAHTin_hQrRb5WE36N6ieqUtMo1XCkQFuJYq9krO8gBoCa6UQAvD_BwE | |
| https://www.kabum.com.br/cgi-local/site/produtos/descricao_ofertas.cgi?codigo=69279&gclid=CjwKCAjwk6P2BRAIEiwAfVJ0rDGJzGiihd4AAHTin_hQrRb5WE36N6ieqUtMo1XCkQFuJYq9krO8gBoCa6UQAvD_BwE |
| <div id="app"></div> |
| <div id="app"></div> |
| // Type JavaScript here and click "Run Code" or press Ctrl + s | |
| // console.log('Hello, world!'); | |
| // CHALLENGE 1 | |
| function createFunction() { | |
| return function() { | |
| console.log("hello"); | |
| }; | |
| } |
| //referencia do prompt | |
| var bannerInstall; | |
| if ('serviceWorker' in navigator){ | |
| navigator.serviceWorker | |
| .register('sw.js') | |
| .then(function () { | |
| console.log('Service worker está registrado!'); | |
| }); | |
| } |
| var counter = 0; | |
| var i = setInterval(function() { | |
| window.InputEvent = window.Event || window.InputEvent; | |
| var d = new Date(); | |
| var event = new InputEvent('input', { | |
| bubbles: true | |
| }); | |
| var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text'); | |
| var textToSend = "Me responde!"; |
| import $ from 'dom7'; | |
| import Template7 from 'template7'; | |
| import Utils from '../utils/utils'; | |
| const tempDom = document.createElement('div'); | |
| class Framework7Component { | |
| constructor(c, extend = {}) { | |
| const context = Utils.extend({}, extend); | |
| const component = Utils.extend(this, c, { context }); |