Answers for "js how to check array include one false"

9

check if a variable is array in javascript

// inside if else check
if(Array.isArray(myVarToTest)) {
	// myVatToTest is an array
} else {
	// myVarToTest is not an array
}
Posted by: Guest on January-08-2021
0

how to check value is array or not in javascript

// how to check value is array or not in javascript
const str = "foo";
const check = Array.isArray(str);
console.log(check);
// Result: false

const arr = [1,2,3,4];
const output = Array.isArray(arr);
console.log(output);
// Result: true
Posted by: Guest on January-07-2022

Code answers related to "js how to check array include one false"

Code answers related to "Javascript"

Browse Popular Code Answers by Language