-
Ajout d'un projet institutionnel
let payload = { title: "Destruction du monde", describe: "Thanos avait une bonne idée", identity: { name: "Batuta", firstname: "Sael",
email: "[email protected]",
This file contains 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
/** | |
* Cette insère une - entre deux nombre impair dans une chaine | |
* @param {String} str | |
* @return {String} | |
*/ | |
function dashInsert(str) { | |
let newString = str[0] || ''; | |
for (let i = 1, lastNumberIsOdd = str[0] % 2 === 1; i < str.length; i++) { | |
const numberIsOdd = str[i] % 2 === 1; |
This file contains 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
/** | |
* Une fonction qui teste si le deuxième nombre passé en paramètre est plus grand que le premier | |
* @param {Number} num1 | |
* @param {Number} num2 | |
* @return {String} | |
*/ | |
function checkNums(num1, num2) { | |
if (num2 > num1) { | |
return 'true'; | |
} else if (num1 === num2) { |
This file contains 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
/** | |
* Cette fonction permet de classe les lettres d'un mot passé en paramètre de la fonction du plus petit au plus grand selon l'alphabet français | |
* @param {String} str La chaine de caractère | |
*/ | |
function alphabetSoup(str) { | |
let letters = str.split(''); | |
return letters.sort((a, b) => { | |
if(a.charCodeAt(0) > b.charCodeAt(0)) return 1 | |