Message from JavaScript discussions

February 2019

— You’re shockingly cryptic

— 

If-then-else is *long* so you get a long line with syntax copies inside like return/return, assign/assign

— Hi guys, how can i archieve
const vehicleinfo = {
capacity_2: null
}
const {capacity_2 = 0} = vehicleinfo;

Message permanent page

— Kind of a nested default thought

— What do you want

— Capacity_2 not to be null

— But an integer

— Just set it ?

— Vehicleinfo.capacity_2 = 0

— Https://github.com/tc39/proposal-pattern-matching

— 

const capacity_2 =
vehicleinfo.capacity_2 || 0;

— Jea ok, but isnt the idea nice?