Skip to content

Instantly share code, notes, and snippets.

@RinatValiullov
Created November 15, 2019 08:54
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 RinatValiullov/9645abd279eddbe1aed079e6527e00e9 to your computer and use it in GitHub Desktop.
Save RinatValiullov/9645abd279eddbe1aed079e6527e00e9 to your computer and use it in GitHub Desktop.
For translation of article "Performance of JavaScript optional chaining" - https://bit.ly/33Pg0uv
function d(n,t,o,i,l){for(t=t.split?t.split("."):t,i=0;i<t.length;i++)n=n?n[t[i]]:l;return n===l?o:n}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment