Convert string to array in Javascript

Something Like that:
split()

add this JS code.

JS

var newStr = "Amit";
var newArr = newStr.split();

console.log(newStr);
console.log(newArr);

[codepen_embed height=”265″ theme_id=”0″ slug_hash=”Bmevjg” default_tab=”js,result” user=”pradeepanvi”]See the Pen Convert string to array in Javascript by Pradeep Kumar (@pradeepanvi) on CodePen.[/codepen_embed]

You can check console.

Leave a Reply

Your email address will not be published. Required fields are marked *