Introduction to Strings
1) .charCodeAt() method to find the ASCII number of all the letters, characters and numbers.
2) Logic to Understand & Revise
let currentLine = ["is", "hms", "xy"];
let spaces = 3;
let j = 0;
while (spaces) {
if (j === currentLine.length - 1) {
j = 0;
continue;
}
currentLine[j] += " "
spaces--;
j++;
}
console.log(currentLine.map(a => [a, a.length]));
3)



Comments
Post a Comment