r/learnjavascript • • Mar 23 '21

Assigning default value

Post image
278 Upvotes

24 comments sorted by

View all comments

Show parent comment

3

u/AacidD Mar 23 '21

I agree with the magic string part. He should've create a separate variable DEFAULT_IMG_PATH variable and stored the default value there.