Closed felipexbenevides closed 8 years ago
declaring name variable in global scope, treat the value as name of window, so it tries to typecast any thing in string. So why when you do
var name = family.find('name') //in global space
//name is '[object Object]' as a string
If you try same thing inside a function it will work. Try
(function(){
var family = jsonQ(jsonObj),
name = family.find('name');
console.log(name.path())
}())
Read http://stackoverflow.com/questions/20945498/var-name-produces-strange-result-in-javascript
I will update the docs as it is misleading.
i have a problem,
name.path is not a function jsonQ