What is a better way to write this in JS
let foo
if(bar) foo = bar.value
I am trying to avoid react error when bar is null if i use const foo = bar.value
.
Source: Ask Javascript Questions
What is a better way to write this in JS
let foo
if(bar) foo = bar.value
I am trying to avoid react error when bar is null if i use const foo = bar.value
.
Source: Ask Javascript Questions