Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
First version of CoffeeScript's ?. in JavaScript thanks to sweet.js
macro ?. {
rule infix {
$lhs:expr | $rhs:expr
} => {
$lhs && $lhs.$rhs
}
}
// obj?.possiblyNullProperty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.