dupontL2
Pages
Accueil
Learn !
function code (start, end, step = 1) {
return new Array(Math.ceil((end.charCodeAt(0) - start.charCodeAt(0))/step))
.fill(start.charCodeAt(0))
.map((x, i) => String.fromCharCode(i*step + start.charCodeAt(0)));
}
console.log(code('c', 'h', 2));
Article plus ancien
Accueil