js-delete

function/macrosince v0.0-927Edit
(js-delete obj key)

Details:

Deletes property key in JavaScript object obj.

Equivalent to delete obj[key] in JavaScript.


Examples:

(def a #js {:foo 1 :bar 2})
(js-delete a "foo")

a
;;=> #js {:bar 2}

See Also:


Source docstring:
Delete a property from a JavaScript object.
Returns true upon success, false otherwise.
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn js-delete
  [obj key]
  (cljs.core/js-delete obj key))

Macro code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro js-delete [obj key]
  (core/list 'js* "delete ~{}[~{}]" obj key))