MCPcopy
hub / github.com/SeleniumHQ/selenium / add

Function add

third_party/closure/goog/object/object.js:335–340  ·  view source on GitHub ↗

* Adds a key-value pair to the object. Throws an exception if the key is * already in use. Use set if you want to change an existing pair. * @param {?Object } obj The object to which to add the key-value pair. * @param {string} key The key to add. * @param {V} val The value to add. * @retur

(obj, key, val)

Source from the content-addressed store, hash-verified

333 * @template K,V
334 */
335function add(obj, key, val) {
336 if (obj !== null && key in obj) {
337 throw new Error(`The object already contains the key "${key}"`);
338 }
339 set(obj, key, val);
340}
341
342/**
343 * Returns the value for the given key.

Callers

nothing calls this directly

Calls 1

setFunction · 0.85

Tested by

no test coverage detected