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

Popular posts from this blog