check if object is moving\ code example
Example 1: javascript check if variable is object
let myObject = {
firstname: 'harry',
lastname: 'potter'
}
//check the typeof if, boolean, object, string etc...
console.log(typeof myObject);
if(typeof myObject === 'object') {
console.log('this is object');
}
Example 2: javascript check if is array
var colors=["red","green","blue"];
if(Array.isArray(colors)){
//colors is an array
}