Skip to content

Instantly share code, notes, and snippets.

@beshur
Created September 20, 2014 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beshur/50cb61829b1a9d5d7ca6 to your computer and use it in GitHub Desktop.
Save beshur/50cb61829b1a9d5d7ca6 to your computer and use it in GitHub Desktop.
javascript get deep level of object
var data = {a: {b: 1}};
var type = {l1: "a", l2: "b"};
console.log("pos:", data[type.l1][type.l2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment