Skip to content

Instantly share code, notes, and snippets.

@b2977053
Created February 6, 2020 05:56
Show Gist options
  • Save b2977053/98f8ef4dd1bdab84aadd50886d93910b to your computer and use it in GitHub Desktop.
Save b2977053/98f8ef4dd1bdab84aadd50886d93910b to your computer and use it in GitHub Desktop.
New in Chrome 80  |  Web  |  Google Developers
https://developers.google.com/web/updates/2020/02/nic80?fbclid=IwAR2nKXVG8kxLpJ2kgwVbLqYiAbEIXvGUMkeiuKFcQczVhgbHJoo470RyFww#opt-chaining
var ABC = function(){this.a = '123'}
ABC.prototype._fun1 = function(){return this.a.length}
ABC.prototype._fun2 = function(){return this.b?.length}
var abc = new ABC();
abc._fun1() // 3
abc._fun2() // undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment