Skip to content

Instantly share code, notes, and snippets.

View darksh3ll's full-sized avatar

DARKSH3LL darksh3ll

  • France
View GitHub Profile
//Desctructering
console.log("Destructuring");
const arr = [12,14,2,8,6,3,1,0];
console.log(Math.min(...arr));
@darksh3ll
darksh3ll / .js
Created June 15, 2018 06:43
renvoie le minimun
//Math.min
console.log("Math.Min");
//Math.min => renvoie le minimun\
console.log(Math.min(12,36,5,1));
@darksh3ll
darksh3ll / .js
Created June 15, 2018 06:42
décimal aprés la virgules
console.log("toFixed");
//to fixed => décimal aprés la virgules
console.log(pi.toFixed(2)); //Renvoie 2 décimales aprés la virgules
@darksh3ll
darksh3ll / .js
Last active June 15, 2018 07:58
Renvoie le carré d'un nombres
//Math.pow => Renvoie le carré d'un nombres
console.log("Math.pow ");
const carre = Math.pow(2,2); //Carré de 2
console.log(carre);
@darksh3ll
darksh3ll / forOf.js
Last active June 15, 2018 06:15
parcourir un tableau avec la forof
console.log("ES5");
//ES5
const arr = [12,23,54,65];
for ( let i = 0; i < arr.length; i++ ) {
console.log(arr[i]);
}
console.log("ES6");
//ES6
const arr1 = [12,23,54,65,100];
for (let nombres of arr1 ) {
const mot = "nicolewrobel";
let motInverse = "";
for (let i = 0; i < mot.length; i++) {
motInverse = mot[i] + motInverse;
}
if (mot === motInverse) {
console.log("Palindrone")
}else {
console.log("no palindrone")
}
sudo npm update -g
//Plus grand
const score = [23,78,65,100,89,999,87,1020];
console.log(Math.max(...score));
//Plus petit
console.log(Math.min(...score));
header {
height: 700px;
background: url(/img/neonbrand-268902-unsplash.jpg);
background-size: cover;
background-position: center;
box-shadow: 4px 3px 13px 6px #000000c4;
}
@media screen and (min-width: 425px) {
}