Answers for "how to seperate words seperated by commas using javascript"

0

how to seperate words seperated by commas using javascript

var names = 'Harry,John,Clark,Peter,Rohn,Alice';
var nameArr = names.split(',');
console.log(nameArr);
    
// Accessing individual values
alert(nameArr[0]); // Outputs: Harry
alert(nameArr[1]); // Outputs: John
alert(nameArr[nameArr.length - 1]); // Outputs: Alice
Posted by: Guest on June-30-2021
0

how to seperate words seperated by commas using javascript

var names = 'Harry,John,Clark,Peter,Rohn,Alice';
var nameArr = names.split(',');
console.log(nameArr);
    
// Accessing individual values
alert(nameArr[0]); // Outputs: Harry
alert(nameArr[1]); // Outputs: John
alert(nameArr[nameArr.length - 1]); // Outputs: Alice
Posted by: Guest on June-30-2021

Code answers related to "how to seperate words seperated by commas using javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language