Test case details

Preparation Code

var arr = [        'that',        'is',        'some',        'nice',        'some',        'test',        'here',     ]         var obj = {        'that' : null,        'is' : null,        'some' : null,        'nice' : null,        'test' : null,        'here' : null     }

Test cases

Test #1

if (arr.indexOf('that') !== -1) {   // found }

Test #2

if ('that' in obj) {   // found }

Test #3

if (arr.indexOf('here') !== -1) {   // found }

Test #4

if ('here' in obj) {   // found }

Test #5

if (typeof obj['that'] !== "undefined") {   // found }

Test #6

if (typeof obj['here'] !== "undefined") {   // found }

Test #7

if (obj['that']) {   // found }

Test #8

if (obj['here']) {   // found }