HTML example code of split a string into an array of substrings, and returns the new array.
<!DOCTYPE HTML> <html> <body> <script> var str = "Hello world, Simple example"; var splitStr = str.split(" "); console.log(splitStr); </script> </body> </html>
Do comment if you have any doubts and suggestions on this JS array topic.
Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version