concaternar null a java
You can use Array.prototype.join
to ignore undefined
and null
:
['a', 'b', void 0, null, 6].join(''); // 'ab6'
According to the spec:
If element is
undefined
ornull
, Let next be the empty String; otherwise, let next be ToString(element).