Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fnEvery = (obj,keys) ->
- pointer = obj
- unless keys.length is 0
- return keys.every (key,index) ->
- pointer = pointer[key]
- return pointer?
- fnSome = (obj,keys) ->
- console.log "НАЧАЛЬНИК! ЭТОТ ПИДАРАС ОБОСРАЛСЯ!"
- input =
- a:
- b: "bydlo"
- c:
- d:
- e: "ebanoe"
- console.log "#############"
- console.log fnEvery(input,[])
- console.log fnEvery(input,["a","b","c"])
- console.log fnEvery(input,["c","d","e"])
- console.log "#############"
- console.log fnSome(input,[])
- console.log fnSome(input,["a","b","c"])
- console.log fnSome(input,["c","d","e"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement