What is the ClojureScript analogue of typeof ... undefined from JavaScript? -
i'm seeing lots of code using pattern:
if (typeof a.b === 'undefined') { ...
now i'm translating to:
(if (nil? (-.b a)) ...
is appropriate - or losing crucial data?
my question is: what clojurescript analogue of typeof ... undefined
javascript?
for checking possibly undefined
references can use cljs.core/exists?
:
(when-not (exists? js/unknownreference) ...)
Comments
Post a Comment