DEV Community

Discussion on: Change your old methods for writing a JavaScript Code - Shorthand's for JavaScript Code

Collapse
 
dred profile image
Anton B

On 6th example i would rather use it in that way
type === 'heigth' ? height() : width()

it is more clear for me and for other i guess, and can be passed different arguments to functions

Collapse
 
mikejacobson profile image
Mike Jacobson

I agree. It also makes it easier to do a global search for all places where those functions are invoked.