split javascript

 <!DOCTYPE html>

<html>

<body>


<h1>JavaScript Strings</h1>

<h2>The split() Method</h2>


<p>split() splits a string into an array of substrings, and returns the array.</p>


<p>The second word is:</p>

<p id="demo"></p>


<script>

let text = "How are you doing today?";

const myArray = text.split(" ");


document.getElementById("demo").innerHTML = myArray[1]; 

</script>


</body>

</html>


From : https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_split1

======



















split javascript split javascript Reviewed by Leo on Maret 16, 2022 Rating: 5

Tidak ada komentar

About me

About Me

My name is Joanne Doe, a lifestyle photographer and blogger currently living in Osaka, Japan. I write my thoughts and travel stories inside this blog.