The in operator returns true if the specified property is in the specified object, otherwise false: - Javascript Operator

Javascript examples for Operator:in

Description

The in operator returns true if the specified property is in the specified object, otherwise false:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var cars = ["A","B","C"];

document.getElementById("demo").innerHTML =
    (cars instanceof Array) + "<br>" +
    (cars instanceof Object) + "<br>" +
    (cars instanceof String) + "<br>" +
    (cars instanceof Number);//from ww  w  .j a v  a2 s  .c  o  m
</script>

</body>
</html>

Related Tutorials