image2text

Untitled

Jul 28th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. /**
  2. * Optional Chaining §on JavaScnipt.
  3. "
  4. * @stage #3 — Release candidate.
  5. gt
  6. const user = {
  7. job: £
  8. type: 'Remote’,
  9. i 8
  10. %
  11. // Uncaught TypeEnnon i§ “job® doesn't exist.
  12. const type = user.job.type;
  13. // OLD WAY — Check intexnmediate nodes.
  14. const type = user.job && user.job.type;
  15. // NEW WAY - Only access “type’ i§ “job" exists.
  16. const type = user.job?.type;
  17. // & #OneDevMinute — @M7AhmadAwais
Advertisement
Add Comment
Please, Sign In to add comment