startsWith() and endsWith() in Javascript
👉 startsWith() and endsWith() in Javascript 👈
<!DOCTYPE html>
<html>
<head>
<title>Test page for positions</title>
<script type="text/javascript">
var str= "HELLO WORLD WELCOME TO THE NEW GENERATION!!";
var b= str.startsWith("HELLO"); //looks for the first word
console.log(b);
var d= str.endsWith("GENERATION!!"); //looks for the last word
console.log(d);
</script>
</head>
<body>
<h1></h1>
</body>
</html>
Comments
Post a Comment
I WOULD APPRECIATE IF YOU LEAVE A COMMENT OR YOUR FEEDBACK HERE !!!