I know that in PHP 5.3 instead of using this redundant ternary operator syntax:
startingNum = startingNum ? startingNum : 1
…we can use a shorthand syntax for our ternary operators where applicable:
startingNum = startingNum ?: 1
And I know about the ternary operator in JavaScript:
startingNum = startingNum ? startingNum : 1
…but is there a shorthand?
Something like that what you’re looking for, where it defaults if undefined?
By the way, this works for a lot of scenarios, including objects: