checking for undefined with typeof
Closed this issue · 0 comments
valtido commented
I would recommend using typeof
in line 28.
elementsByName[ element.name ] = typeof current === "undefined" ? element :
This way all the browsers will convert the undefined
as a string to compare against, because some old browsers would throw an error.
As they don't recognise undefined
as a datatype but as a string.