function/macro | since v0.0-927 | Edit |
(js-delete obj key)
Deletes property key
in JavaScript object obj
.
Equivalent to delete obj[key]
in JavaScript.
(def a #js {:foo 1 :bar 2})
(js-delete a "foo")
a
;;=> #js {:bar 2}
Delete a property from a JavaScript object. Returns true upon success, false otherwise.
(defn js-delete
[obj key]
(cljs.core/js-delete obj key))
(core/defmacro js-delete [obj key]
(core/list 'js* "delete ~{}[~{}]" obj key))