v2
11/11/2020 by zargold -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
var theArr = Array.from({length: 10000}, (_, el) => el)
var theSet = new Set(theArr);
var theObject = Object.assign({}, ...theArr.map(num => ({[num]: true})));
var theTarget = 9000;



function isTargetThereFor (arr, target) {
	const len = arr.length;
	for (let i = 0; i < len; i++) {
		if (arr[i] === target) {
			return true;
		}
	}
	return false;
}
function isTargetThereForReverse(arr, target) {
	const len = arr.length;
	for (let i = len; i > 0; i--) {
		if (arr[i] === target) {
			return true;
    	}
	}
	return false;
}

function isTargetThereIncludes (arr, target) {
	return arr.includes(target);
}

function isTargetThereSet (numberSet, target) {
	return numberSet.has(target);
}

function isTargetThereHasOwnProperty (obj, target) {
	return obj.hasOwnProperty(target);
}
function isTargetThereIn (obj, target) {
	return target in obj;
}
function isTargetThereSelectKey (obj, target) {
	return obj[target];
}
delete caserun single casemove downdrag and drop case


ready



var forLoop = isTargetThereFor(theArr, theTarget);
delete caserun single casemove upmove downdrag and drop case


ready



var forLoopReverse = isTargetThereForReverse(theArr, theTarget);
delete caserun single casemove upmove downdrag and drop case


ready



var includes = isTargetThereIncludes(theArr, theTarget);
delete caserun single casemove upmove downdrag and drop case


ready



var has = isTargetThereSet(theSet, theTarget);
delete caserun single casemove upmove downdrag and drop case


ready



var hasOwnProperty = isTargetThereHasOwnProperty(theObject, theTarget);
delete caserun single casemove updrag and drop case


ready



var keyIn = isTargetThereIn(theObject, theTarget);
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN