includes() in Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>includes method in JS</title>
</head>
<body>
<script>
var arr1 = [1,2,3,4,5];
var arr2 = ["hello","my","name","Is","Praveen"];
console.log(arr1);
var a = arr1.includes(10);
var b = arr2.includes("name");
console.log(a);
console.log(b);
</script>
</body>
</html>
Comments
Post a Comment
I WOULD APPRECIATE IF YOU LEAVE A COMMENT OR YOUR FEEDBACK HERE !!!