Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. # Problem
  2.  
  3. **GIVEN**: Deeply nested structure of objects.
  4. **Find**: "Address of" a particular string property.
  5.  
  6. # Example
  7.  
  8. ## Input
  9.  
  10. ```javascript
  11.  
  12. var sequence3 = {
  13. name: "sequence",
  14. args: [
  15. {
  16. name: "home_all",
  17. args: []
  18. },
  19. {
  20. name: "wait",
  21. args: [{ val: 5000 }]
  22. },
  23. {
  24. name: "if_statement",
  25. args: [{
  26. lhs: "temp",
  27. rhs: 100,
  28. operator: ">",
  29. sequence_id: 2
  30. }]
  31. }
  32. ]
  33. };
  34.  
  35.  
  36. ```
  37.  
  38. ## Usage
  39.  
  40. ```javascript
  41. searchFor("sequence_id", sequence3);
  42. // => [["args", 2, "args", 0], [/* Second result here, if any */]]
  43. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement