Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
let myArrayOne = ['one', 'two', 'three', 'four'],
    myArrayTwo = ['one', 'two', 'three', 'four'];
// remove Array element from each array
// using 2 different techniques
myArrayOne[2] = undefined;
delete myArrayTwo[2];
// same result, both have item as undefined
console.log(myArrayOne, myArrayTwo);
// length = 4 for both
console.log(myArrayOne.length, myArrayTwo.length);
// But the item doesn't exist in one array
console.log(2 in myArrayOne); // true
console.log(2 in myArrayTwo); // false
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ImpressiveWebspro
0viewers