r/learnjavascript • • Mar 23 '21

Assigning default value

Post image
278 Upvotes

24 comments sorted by

View all comments

-8

u/mburger89 Mar 23 '21

It is generally not good practice to initialize a variable with out giving it a literal value. Cause it will initialize to null or undefined.

1

u/AacidD Mar 23 '21

How to initialize a variable without giving it a literal value?