Created
August 2, 2019 17:26
-
-
Save smeijer/e50d1dbdfa6dcb99802d2f82ca0993f4 to your computer and use it in GitHub Desktop.
medium-costs-of-optional-chaining-4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canEdit = user?.can?.edit; | |
var canDelete = user?.can?.delete; | |
// transpiles to: | |
"use strict"; | |
var _user, _user$can, _user2, _user2$can; | |
var canEdit = | |
(_user = user) === null || _user === void 0 | |
? void 0 | |
: (_user$can = _user.can) === null || _user$can === void 0 | |
? void 0 | |
: _user$can.edit; | |
var canDelete = | |
(_user2 = user) === null || _user2 === void 0 | |
? void 0 | |
: (_user2$can = _user2.can) === null || _user2$can === void 0 | |
? void 0 | |
: _user2$can.delete; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment