Last active
November 5, 2015 17:15
-
-
Save FokkeZB/08165210d279766ef67c to your computer and use it in GitHub Desktop.
Checking for Titanium API objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsObject = { | |
foo: 'bar' | |
}; | |
var tiObject = Ti.UI.create2DMatrix(); | |
function isJsObject(obj) { | |
return typeof obj.__proto__ !== 'undefined'; | |
} | |
console.log('jsObject: ' + (isJsObject(jsObject) ? 'yes' : 'no')); | |
console.log('tiObject: ' + (isJsObject(tiObject) ? 'yes' : 'no')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works flawlessy…