Skip to content

Instantly share code, notes, and snippets.

@hal-gh
Created December 22, 2010 16:35
Show Gist options
  • Save hal-gh/751728 to your computer and use it in GitHub Desktop.
Save hal-gh/751728 to your computer and use it in GitHub Desktop.
var window = Titanium.UI.createWindow({
backgroundColor:'red'
});
var view = Titanium.UI.createView({
backgroundColor:"blue"
});
var x = [ 1,2,3,4,5,6 ];
view.myArray = x;
window.add(view);
window.open();
function isArray(obj) {
if (obj.constructor.toString().indexOf("Array") == -1)
return false;
else
return true;
}
Ti.API.info("x type isArray = "+isArray(x));
Ti.API.info("view.myArray[3] = "+view.myArray[3]);
Ti.API.info("view.myArray type = "+typeof(view.myArray));
Ti.API.info("view.myArray type isArray = "+isArray(view.myArray));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment