Master String Manipulation in JavaScript: How to Loop Through Characters
The most interviewer ask that question in front end developer interview that process each character by using loop or they can say without using inbuild function.
So this article will help you to solve your problem statement.
Function:
const iterateString = (str)=>{ let newString = ''; for (let i = 0; i < str.length; i++) { newString = newString + str[i] + " * "; } console.log(newString); }
Usage:
iterateString("PLAYER OF CODE");
Output:
P * L * A * Y * E * R * * O * F * * C * O * D * E *