Skip to content

Instantly share code, notes, and snippets.

@wizard-paso
Created November 6, 2012 10:10
Show Gist options
  • Save wizard-paso/4023846 to your computer and use it in GitHub Desktop.
Save wizard-paso/4023846 to your computer and use it in GitHub Desktop.
title
"text",""
["data","event"]
"events"
[]
events
["events"],
["items"],
["Items"],
["data","items"]
title
["title"],["Title"],
data.title = (data.Title ? data.Title : undefined)
function findData(data,array){
array.forEach(function(value){
var obj=data
var find=true
value.forEach(function(objName){
if(!(obj=obj[objName])){
find=false
return
}
})
if(find){
return obj
}
})
}
"title": function(data){
return findData(data,[["title"],["Title"]])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment