Determining if a variable is an object (version: 1)
Compares three ways of determining if a variable is an object.
- Check if object by comparing value to an object instantiated from the value
- Using typeof
- Using instanceof
Comparing performance of:Check if object by comparing value to an object instantiated from the value - passing in an object vs Check if object by comparing value to an object instantiated from the value - passing in a string vs Check if object by comparing value to an object instantiated from the value - passing in a string object vs Check if object by comparing value to an object instantiated from the value - passing in an integer vs Check if object by using instanceof - passing in an object vs Check if object by using instanceof - passing in a string vs Check if object by using instanceof - passing in a string object vs Check if object by using instanceof - passing in an integer vs Check if object by using typeof - passing in an object vs Check if object by using typeof - passing in a string vs Check if object by using typeof - passing in a string object vs Check if object by using typeof - passing in an integer