var input = "Hello";
var result = ""
for(var i=0;i<input.length;i++)
{
var curr = String.fromCharCode(input.charCodeAt(i)+1);
result = result +curr;
}
console.log(result);
const str = "zbaac";
const result1 = Array.prototype.map
.call(str, (item) => {
let result;
if (item.match(/[aeiou]/)) {
result = item.toUpperCase();
} else result = item;
return result;
})
.join("");
console.log(result1);
const result2 = Array.prototype.reduce.call(result1, (acc, cur, index) => {
if ((index + 1 ) % 3 === 0) {
return acc + "X";
}
return acc + cur;
});
baseUrl을 src 폴더 로 설정
{
"compilerOptions": {
"baseUrl": "src"
},
"includes": ["src"]
}