JS trim split float

PHOTO EMBED

Fri May 13 2022 05:37:48 GMT+0000 (Coordinated Universal Time)

Saved by @bluegirlfan #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 id="demo"></p>

<script>
let text = " 0.00 ";
const myArray = text.trim().split(".");

document.getElementById("demo").innerHTML = myArray[1]; 
</script>

</body>
</html>
content_copyCOPY

Gets the digits after the floating point

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