This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- name: 'gcr.io/cloud-builders/npm' | |
id: 'Install dependencies' | |
args: ['install'] | |
- name: 'gcr.io/cloud-builders/npm' | |
id: 'Lint' | |
args: ['run', 'lint'] | |
- name: 'gcr.io/cloud-builders/npm' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- name: 'gcr.io/cloud-builders/npm' | |
id: 'Install dependencies' | |
args: ['install'] | |
- name: 'gcr.io/cloud-builders/npm' | |
id: 'Lint' | |
args: ['run', 'lint'] | |
- name: 'gcr.io/cloud-builders/npm' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elements = document.querySelectorAll('button'); | |
const len = elements.length; // 8 par exemple | |
for(let i=0; i<len; i+=1){ | |
(function(n){ | |
elements[n].addEventListener('click', function(){ | |
alert(n+1) | |
}, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elements = document.querySelectorAll('button'); | |
const len = elements.length; // 8 par exemple | |
for(let i=0; i<len; i+=1){ | |
elements[i].addEventListener('click', function() { | |
alert(i+1) | |
}, false); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jedi = (function(what) { | |
const say = `I'm your ${what}!`; | |
return (() => `Luke, ${say}`)(); | |
})("father"); | |
console.log(jedi); // "Luke, I'm your father!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A | |
const luke = function(){}; | |
const jedi = luke(); | |
// B | |
const luke = function(){}; | |
const jedi = (luke)(); | |
// C | |
const jedi = (function(){})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ })() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const delay = curry(setTimeout, 1000); | |
delay(() => alert("POWNED!!")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function curry() { | |
const [fn, ...restArgs] = Array.from(arguments); | |
return function() { | |
const args = Array.from(arguments); | |
return fn.apply(null, args.concat(restArgs)); | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#content { | |
width: 27px; | |
height: 40px; | |
background: red; | |
position: relative; | |
border-radius: 50%; | |
line-height: 40px; | |
padding-left: 14px; | |
color: white; |