file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/object/__definegetter__/index.md | JavaScript - Global Objects - Object - defineGetter - Syntax - Return value:
None (`undefined`). | [
-0.6419081091880798,
0.31125548481941223,
-1.4575904607772827,
-1.0585249662399292,
-0.8673014640808105,
-1.6291123628616333,
0.3545568287372589,
0.7981089353561401,
-0.6182997822761536,
0.20820970833301544,
-0.4397113025188446,
-0.1023654192686081,
-0.3353642225265503,
0.23710915446281433... |
javascript/reference/global_objects/object/__definegetter__/index.md | JavaScript - Global Objects - Object - defineGetter - Syntax - Exceptions:
- `TypeError`: Thrown if `func` is not a function. | [
-0.8270255923271179,
0.023828567937016487,
-1.2157138586044312,
-0.18143194913864136,
-0.7015669941902161,
-1.574826717376709,
-0.5604926943778992,
0.9272456169128418,
-0.46499595046043396,
-0.4235702157020569,
-0.31548815965652466,
-0.5303075313568115,
-0.24230635166168213,
-0.17674410343... |
javascript/reference/global_objects/object/__definegetter__/index.md | JavaScript - Global Objects - Object - defineGetter - Description:
All objects that inherit from `Object.prototype` (that is, all except `null`-prototype objects) inherit the `__defineGetter__()` method. This method allows a getter to be defined on a pre-existing object. This is equivalent to `Object.defineProperty(ob... | [
-1.2728796005249023,
-0.23138858377933502,
-1.4329766035079956,
0.37996551394462585,
-0.34806427359580994,
-2.2832460403442383,
0.32066020369529724,
0.5461581945419312,
0.23035262525081635,
-0.5059155225753784,
-0.7397898435592651,
-0.018894821405410767,
-0.030913813039660454,
0.3492935597... |
javascript/reference/global_objects/object/__definegetter__/index.md | JavaScript - Global Objects - Object - defineGetter - Examples - Using defineGetter():
Example:
const o = {};
o.__defineGetter__("gimmeFive", function () {
return 5;
});
console.log(o.gimmeFive); // 5 | [
-0.08507222682237625,
-0.0921584963798523,
-1.51479172706604,
0.28224655985832214,
-0.21568167209625244,
-1.906482219696045,
-0.4530643820762634,
0.4242415130138397,
-0.04035590589046478,
0.23651039600372314,
-0.27269089221954346,
-0.1944732964038849,
-0.790477991104126,
-0.044560972601175... |
javascript/reference/global_objects/object/__definegetter__/index.md | JavaScript - Global Objects - Object - defineGetter - Examples - Defining a getter property in standard ways:
You can use the `get` syntax to define a getter when the object is first initialized.
Example:
const o = {
get gimmeFive() {
return 5;
},
};
console.log(o.gimmeFive); // 5
You may also use `Object.d... | [
-0.28656938672065735,
0.2379620373249054,
-0.7247398495674133,
0.2533217966556549,
0.2110983431339264,
-2.3184127807617188,
-0.06473338603973389,
0.6898312568664551,
0.20805104076862335,
0.48216164112091064,
-0.39115747809410095,
-0.2769801616668701,
-0.6670745015144348,
0.0419273376464843... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf:
The `valueOf()` method of `Object` instances converts the `this` value to an object. This method is meant to be overridden by derived objects for custom type conversion logic.
Example:
function MyNumberType(n) {
this.number = n;
}
MyNumberType.prototype.valueOf = fu... | [
-0.07930832356214523,
-0.5285478830337524,
-0.42638155817985535,
0.24500931799411774,
0.0038664445746690035,
-1.3707669973373413,
-0.31142646074295044,
0.39462628960609436,
0.11851752549409866,
-0.38768497109413147,
-1.069875717163086,
0.08215723186731339,
-0.00976288691163063,
0.502810776... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Syntax:
Example:
valueOf() | [
0.18230371177196503,
-0.09125372767448425,
-0.591367244720459,
-0.3781670033931732,
-0.4931870400905609,
-1.6248735189437866,
0.742200493812561,
1.0138378143310547,
0.3781201243400574,
-1.0427100658416748,
-0.5619086623191833,
0.47187110781669617,
-0.2357555329799652,
0.27790936827659607,
... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Syntax - Parameters:
None. | [
0.028861304745078087,
0.2956489026546478,
-1.0174161195755005,
-0.6084980964660645,
-0.6072791218757629,
-1.2893266677856445,
1.0154520273208618,
1.0346392393112183,
-0.10718267410993576,
-1.1247929334640503,
-0.8755152225494385,
-0.39700889587402344,
-0.13859084248542786,
0.19821764528751... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Syntax - Return value:
The `this` value, converted to an object.
Note: In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `primitiveValue.valueOf()` generally d... | [
-0.14340519905090332,
0.22112759947776794,
-0.2849847078323364,
0.08420412987470627,
-0.5497772097587585,
-1.1154717206954956,
0.8878785371780396,
1.2074052095413208,
0.28244203329086304,
-0.6774980425834656,
-1.0697143077850342,
0.6594856977462769,
-0.048215508460998535,
0.560368597507476... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Description:
JavaScript calls the `valueOf` method to convert an object to a primitive value. You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected.
This method is ca... | [
-0.5444155335426331,
-0.08801808208227158,
-0.6914782524108887,
0.6455496549606323,
0.08770188689231873,
-1.2358341217041016,
1.0873433351516724,
-0.2698582708835602,
-0.32888707518577576,
-0.23388877511024475,
-0.6495168805122375,
0.20753857493400574,
-0.3880944848060608,
0.37418508529663... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Examples - Using valueOf():
The base `valueOf()` method returns the `this` value itself, converted to an object if it isn't already. Therefore its return value will never be used by any primitive conversion algorithm.
Example:
const obj = { foo: 1 };
console.log(obj.v... | [
-0.3843557834625244,
0.21691416203975677,
-1.072554349899292,
0.24935905635356903,
-0.6380961537361145,
-1.2639927864074707,
1.1575440168380737,
0.5749390125274658,
-0.06345798075199127,
-0.41240155696868896,
-0.9894521236419678,
0.3994152545928955,
0.28641119599342346,
0.08341825753450394... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Examples - Overriding valueOf for custom objects:
You can create a function to be called in place of the default `valueOf` method. Your function should take no arguments, since it won't be passed any when called during type conversion.
For example, you can add a `value... | [
0.5863527655601501,
-0.33474045991897583,
-0.6165977120399475,
1.2853573560714722,
0.5181095600128174,
-1.6774743795394897,
0.38588690757751465,
0.28935399651527405,
-0.49141067266464233,
-0.8560401797294617,
-0.45671167969703674,
-0.15543067455291748,
-0.15256458520889282,
0.4355282485485... |
javascript/reference/global_objects/object/valueof/index.md | JavaScript - Global Objects - Object - valueOf - Examples - Using unary plus on objects:
Unary plus performs number coercion on its operand, which, for most objects without `[Symbol.toPrimitive]()`, means calling its `valueOf()`. However, if the object doesn't have a custom `valueOf()` method, the base implementation ... | [
-0.6109801530838013,
0.3081803321838379,
-0.849320113658905,
0.37518495321273804,
-0.151908278465271,
-1.1045743227005005,
0.08150627464056015,
0.5561186075210571,
-0.8117353916168213,
-0.4742165207862854,
-1.4014246463775635,
-0.29125094413757324,
-0.5700545907020569,
-0.2767654359340668,... |
javascript/reference/global_objects/object/groupby/index.md | JavaScript - Global Objects - Object - groupBy:
Note: In some versions of some browsers, this method was implemented as the method `Array.prototype.group()`. Due to web compatibility issues, it is now implemented as a static method. Check the browser compatibility table for details.
The `Object.groupBy()` static meth... | [
-0.08238285034894943,
-0.17346961796283722,
-0.6842672824859619,
0.944642961025238,
0.4268258810043335,
-0.7923015356063843,
0.9611066579818726,
0.04800640791654587,
-0.545640230178833,
0.7109556794166565,
-0.31741079688072205,
-0.1571653187274933,
0.0053652613423764706,
0.4800271093845367... |
javascript/reference/global_objects/object/groupby/index.md | JavaScript - Global Objects - Object - groupBy - Syntax:
Example:
Object.groupBy(items, callbackFn) | [
0.08480324596166611,
0.33714163303375244,
-0.9293999075889587,
0.03897977992892265,
-0.8192991614341736,
-1.834830641746521,
0.32871127128601074,
-0.498715877532959,
-1.1162687540054321,
-0.0647290050983429,
-0.989079475402832,
0.24405242502689362,
-0.2625776529312134,
0.5294761657714844,
... |
javascript/reference/global_objects/object/groupby/index.md | JavaScript - Global Objects - Object - groupBy - Syntax - Parameters:
- `items`: An iterable (such as an `Array`) whose elements will be grouped.
- `callbackFn`: A function to execute for each element in the iterable. It should return a value that can get coerced into a property key (string or symbol) indicating the g... | [
-0.06302773952484131,
0.21338412165641785,
-0.9275328516960144,
0.3857659697532654,
-0.24393856525421143,
-1.85444176197052,
0.32168400287628174,
-0.3183959722518921,
-0.9380767941474915,
0.6680955290794373,
-1.3175809383392334,
0.35439854860305786,
-0.790090799331665,
1.1167736053466797,
... |
javascript/reference/global_objects/object/groupby/index.md | JavaScript - Global Objects - Object - groupBy - Syntax - Return value:
A `null`-prototype object with properties for all groups, each assigned to an array containing the elements of the associated group. | [
-0.5615294575691223,
0.11575087904930115,
-0.35216957330703735,
0.34979143738746643,
-0.6361982822418213,
-1.572948932647705,
1.0538485050201416,
0.6283645629882812,
-0.354265958070755,
0.11454406380653381,
-0.9172366261482239,
0.8963951468467712,
0.1817701905965805,
0.5703815817832947,
... |
javascript/reference/global_objects/object/groupby/index.md | JavaScript - Global Objects - Object - groupBy - Description:
`Object.groupBy()` calls a provided `callbackFn` function once for each element in an iterable. The callback function should return a string or symbol (values that are neither type are coerced to strings) indicating the group of the associated element. The ... | [
-0.7001758217811584,
0.3022049069404602,
-1.4515875577926636,
0.20916573703289032,
-0.24926549196243286,
-1.678061842918396,
1.0834732055664062,
-0.9918493628501892,
-1.7819066047668457,
0.6328091621398926,
-0.6248620748519897,
0.5038843750953674,
-0.3300808370113373,
0.6899769902229309,
... |
javascript/reference/global_objects/object/groupby/index.md | JavaScript - Global Objects - Object - groupBy - Examples - Using Object.groupBy():
First we define an array containing objects representing an inventory of different foodstuffs. Each food has a `type` and a `quantity`.
Example:
const inventory = [
{ name: "asparagus", type: "vegetables", quantity: 5 },
{ name: ... | [
0.09446047991514206,
0.04263458400964737,
-0.629052996635437,
1.0855015516281128,
0.3098156452178955,
-0.6355355978012085,
0.12326940149068832,
0.674712061882019,
-0.6803117990493774,
-0.206812784075737,
-0.2860645055770874,
-0.12877728044986725,
-0.4805109202861786,
0.24000996351242065,
... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal:
The `Object.seal()` static method seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability... | [
-1.1771163940429688,
0.2687193751335144,
-1.301637053489685,
-0.06934056431055069,
0.08557397872209549,
-1.814435362815857,
-0.14094969630241394,
1.1624634265899658,
-0.5037980675697327,
0.3930433392524719,
-0.10072657465934753,
0.3711607754230499,
0.17906352877616882,
0.04963527247309685,... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal - Syntax:
Example:
Object.seal(obj) | [
-0.8993250131607056,
0.5818036794662476,
-1.4007904529571533,
-0.811798095703125,
-0.6611078977584839,
-1.779661774635315,
0.11070573329925537,
1.1799988746643066,
-0.45782360434532166,
-0.2952425181865692,
0.16205601394176483,
0.5414397716522217,
-0.13770471513271332,
0.20242102444171906,... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal - Syntax - Parameters:
- `obj`: The object which should be sealed. | [
-0.740340530872345,
0.8703078627586365,
-1.3422274589538574,
-0.8249968886375427,
-0.45641767978668213,
-1.8402791023254395,
-0.5619458556175232,
0.5113282203674316,
-0.14414559304714203,
0.07274527847766876,
-0.5065498948097229,
0.5393901467323303,
-0.23455820977687836,
0.7982736229896545... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal - Syntax - Return value:
The object being sealed. | [
-0.5759404301643372,
0.6627084016799927,
-1.1214340925216675,
-0.6559056639671326,
-0.6342564225196838,
-1.416731595993042,
-0.350686252117157,
1.6535964012145996,
-0.3970922827720642,
0.09482013434171677,
-0.1387963443994522,
0.8767849206924438,
-0.22913280129432678,
1.0312613248825073,
... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal - Description:
Sealing an object is equivalent to preventing extensions and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable also preve... | [
-1.3244171142578125,
0.4301881492137909,
-1.0918599367141724,
0.09501318633556366,
-0.35459423065185547,
-1.613207459449768,
0.02362251654267311,
1.2316508293151855,
-0.03907160460948944,
-0.13370251655578613,
-0.5174371004104614,
0.23151010274887085,
-0.21463671326637268,
-0.3241201937198... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal - Examples - Using Object.seal:
Example:
const obj = {
prop() {},
foo: "bar",
};
// New properties may be added, existing properties
// may be changed or removed.
obj.foo = "baz";
obj.lumpy = "woof";
delete obj.prop;
const o = Object.seal(obj);
o === obj; // true
Obj... | [
-0.266321063041687,
0.34194332361221313,
-0.6947181820869446,
0.048447854816913605,
-0.04493607208132744,
-0.30350786447525024,
0.009798151440918446,
0.30318039655685425,
-0.25500690937042236,
-0.495155930519104,
-0.7150965332984924,
0.1325773298740387,
-0.26805195212364197,
0.084244243800... |
javascript/reference/global_objects/object/seal/index.md | JavaScript - Global Objects - Object - seal - Examples - Non-object argument:
In ES5, if the argument to this method is not an object (a primitive), then it will cause a `TypeError`. In ES2015, a non-object argument will be returned as-is without any errors, since primitives are already, by definition, immutable.
Exa... | [
-0.5950034856796265,
-0.014652861282229424,
-0.5464309453964233,
-0.029158208519220352,
-0.06929503381252289,
-2.766294002532959,
0.6206746697425842,
1.533290982246399,
-0.31609049439430237,
0.2839387059211731,
0.2191362977027893,
-0.5313425660133362,
-0.009297707118093967,
-0.259669274091... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn:
The `Object.hasOwn()` static method returns `true` if the specified object has the indicated property as its own property. If the property is inherited, or does not exist, the method returns `false`.
Note: `Object.hasOwn()` is intended as a replacement for `Object.protot... | [
-0.9375401735305786,
-0.20444412529468536,
-0.8122563362121582,
0.23859430849552155,
-0.1704416126012802,
-2.10275936126709,
0.1945287436246872,
0.4090178310871124,
-0.2993556559085846,
0.5207902789115906,
-0.8796584010124207,
0.19543981552124023,
-0.13754481077194214,
-0.4756443202495575,... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Syntax:
Example:
Object.hasOwn(obj, prop) | [
0.009886210784316063,
0.3242524564266205,
-1.1359318494796753,
-0.5628970861434937,
-0.7197908759117126,
-1.834080696105957,
0.025956930592656136,
0.38020992279052734,
-0.29151907563209534,
-0.10011256486177444,
-0.9636487364768982,
0.30258306860923767,
-0.5402514934539795,
-0.355118989944... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Syntax - Parameters:
- `obj`: The JavaScript object instance to test.
- `prop`: The `String` name or Symbol of the property to test. | [
-0.48675936460494995,
-0.44621285796165466,
-0.8390980958938599,
-0.26142728328704834,
-0.04776833578944206,
-1.9243983030319214,
0.10165264457464218,
-0.2696376442909241,
-0.3060291111469269,
0.13533923029899597,
-1.2957377433776855,
0.35843124985694885,
-0.47220322489738464,
0.0228205677... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Syntax - Return value:
`true` if the specified object has directly defined the specified property. Otherwise `false` | [
-0.8621509671211243,
-0.0852668508887291,
-0.6826590895652771,
0.176443412899971,
-0.8385723233222961,
-2.2483277320861816,
0.767095148563385,
0.184187650680542,
-0.5442014932632446,
0.28208020329475403,
-0.9450480937957764,
0.2087850272655487,
0.1272445023059845,
0.02551707811653614,
0.... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Description:
The `Object.hasOwn()` method returns `true` if the specified property is a direct property of the object — even if the property value is `null` or `undefined`. The method returns `false` if the property is inherited, or has not been declared at all. Unlike t... | [
-0.7562557458877563,
0.1420440673828125,
-1.1613723039627075,
0.48792365193367004,
-0.07960010319948196,
-1.8094416856765747,
0.6809917688369751,
0.26220399141311646,
-0.4374416768550873,
0.46526089310646057,
-1.224516749382019,
0.390899121761322,
0.3130035996437073,
-0.40260788798332214,
... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Examples - Using Object.hasOwn() to test for a property's existence:
The following code shows how to determine whether the `example` object contains a property named `prop`.
Example:
const example = {};
Object.hasOwn(example, "prop"); // false - 'prop' has not been def... | [
-1.0444064140319824,
-0.08724286407232285,
-0.6068698167800903,
0.15346458554267883,
-0.460653156042099,
-1.6425280570983887,
0.6999738216400146,
0.3980422616004944,
-0.14539124071598053,
0.4838651716709137,
-1.122437596321106,
0.294437438249588,
-0.7989400625228882,
-0.3412390947341919,
... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Examples - Direct vs. inherited properties:
The following example differentiates between direct properties and properties inherited through the prototype chain:
Example:
const example = {};
example.prop = "exists";
// `hasOwn` will only return true for direct properti... | [
-0.5457322001457214,
0.017691614106297493,
-0.15308086574077606,
0.13210022449493408,
-0.40893247723579407,
-2.369687795639038,
0.13143430650234222,
0.7843455076217651,
0.18643799424171448,
0.24203667044639587,
-0.5344988107681274,
0.3184012174606323,
-0.7835462093353271,
-0.51013731956481... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Examples - Iterating over the properties of an object:
To iterate over the enumerable properties of an object, you should use:
Example:
const example = { foo: true, bar: true };
for (const name of Object.keys(example)) {
// …
}
But if you need to use `for...in`, you... | [
-0.22483594715595245,
0.21629656851291656,
-0.05493540316820145,
0.9819625020027161,
-0.09315867722034454,
-2.7317378520965576,
0.4200206696987152,
0.11506359279155731,
-0.8594905138015747,
-0.20597174763679504,
-0.3917189836502075,
0.46069324016571045,
-0.3388272821903229,
-0.306019097566... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Examples - Checking if an Array index exists:
The elements of an `Array` are defined as direct properties, so you can use `hasOwn()` method to check whether a particular index exists:
Example:
const fruits = ["Apple", "Banana", "Watermelon", "Orange"];
Object.hasOwn(fr... | [
-0.5416584014892578,
-0.3640230596065521,
-0.7867051362991333,
0.6431414484977722,
-0.4407879412174225,
-1.0746814012527466,
0.7727704048156738,
0.3746194839477539,
-0.29515916109085083,
0.2934200167655945,
-0.45505252480506897,
-0.5856422781944275,
-0.5678477883338928,
-0.1098969802260398... |
javascript/reference/global_objects/object/hasown/index.md | JavaScript - Global Objects - Object - hasOwn - Examples - Problematic cases for hasOwnProperty():
This section demonstrates that `Object.hasOwn()` is immune to the problems that affect `hasOwnProperty()`. Firstly, it can be used with objects that have re-implemented `hasOwnProperty()`. In the example below, the re-im... | [
0.09847954660654068,
0.21867500245571136,
-0.40343087911605835,
0.6642410159111023,
0.5629299879074097,
-1.1543012857437134,
0.16143471002578735,
0.7735520601272583,
-0.49466320872306824,
0.4387185275554657,
-1.149525761604309,
0.36505553126335144,
-0.35447150468826294,
-0.1497485190629959... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible:
The `Object.isExtensible()` static method determines if an object is extensible (whether it can have new properties added to it).
Example:
const object = {};
console.log(Object.isExtensible(object));
// Expected output: true
Object.preventExtensions(object);
co... | [
-1.375526785850525,
-0.8343271017074585,
-0.6085557341575623,
0.43648743629455566,
-0.35527095198631287,
-2.4588301181793213,
0.4441840648651123,
0.4577491581439972,
0.3216996490955353,
-0.15990902483463287,
-1.3099929094314575,
0.21162548661231995,
-0.0889853984117508,
-0.2144886255264282... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible - Syntax:
Example:
Object.isExtensible(obj) | [
-0.6775039434432983,
0.007900255732238293,
-0.8149349689483643,
-0.24160136282444,
-0.7944694757461548,
-2.392683267593384,
0.6057038903236389,
0.649566650390625,
0.16782818734645844,
-0.9271669387817383,
-0.9164427518844604,
0.381609171628952,
-0.40235739946365356,
-0.20272330939769745,
... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible - Syntax - Parameters:
- `obj`: The object which should be checked. | [
-0.6352249383926392,
0.24012266099452972,
-1.1209404468536377,
-0.4176855683326721,
-0.3579487204551697,
-1.6795940399169922,
0.4867892265319824,
-0.2542901039123535,
0.16761614382266998,
-0.06418269127607346,
-1.5123590230941772,
0.2990628480911255,
-0.3981187343597412,
0.6516364216804504... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible - Syntax - Return value:
A `Boolean` indicating whether or not the given object is extensible. | [
-1.0754673480987549,
-0.34810924530029297,
-0.5415555238723755,
0.06353794038295746,
-0.8588372468948364,
-1.9441806077957153,
0.7669738531112671,
0.9321517944335938,
0.23482030630111694,
-0.589687168598175,
-1.206540584564209,
1.1561893224716187,
-0.17418141663074493,
0.53892582654953,
... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible - Description:
Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of `Object.preventExtensions()`, `Object.seal()`, `Object.freeze()`, or `Re... | [
-1.6414982080459595,
-0.310597687959671,
-0.614561915397644,
0.17149001359939575,
-0.2593259811401367,
-2.184596061706543,
0.3920285403728485,
1.1212037801742554,
0.16945677995681763,
-0.48856717348098755,
-1.2412488460540771,
0.4950001537799835,
-0.14268037676811218,
-0.07689022272825241,... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible - Examples - Using Object.isExtensible:
Example:
// New objects are extensible.
const empty = {};
Object.isExtensible(empty); // true
// They can be made un-extensible
Object.preventExtensions(empty);
Object.isExtensible(empty); // false
// Sealed objects are by d... | [
-0.9557584524154663,
-0.012693230994045734,
-0.6030084490776062,
0.09180593490600586,
-0.31393155455589294,
-2.707720994949341,
0.07504867017269135,
0.6367517709732056,
0.04334646090865135,
-0.2770843207836151,
-0.8633355498313904,
0.2498503178358078,
-0.480181485414505,
0.0153360785916447... |
javascript/reference/global_objects/object/isextensible/index.md | JavaScript - Global Objects - Object - isExtensible - Examples - Non-object argument:
In ES5, if the argument to this method is not an object (a primitive), then it will cause a `TypeError`. In ES2015, it will return `false` without any errors if a non-object argument is passed, since primitives are, by definition, im... | [
-0.45160385966300964,
-0.4385411739349365,
-0.32347336411476135,
0.03569813445210457,
-0.16850340366363525,
-2.94813871383667,
0.9509699940681458,
0.8746082186698914,
-0.05295156314969063,
0.058390062302351,
-0.3783119320869446,
-0.44723033905029297,
-0.21536025404930115,
-0.37900644540786... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames:
The `Object.getOwnPropertyNames()` static method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object.
Example:
const object = {
a: 1,
b: 2,
c: 3,
};
console.log(O... | [
-0.6801596283912659,
-0.15621116757392883,
-1.7407739162445068,
0.003943165764212608,
-0.335869163274765,
-1.4388765096664429,
0.3968105614185333,
0.26458626985549927,
-0.2219843566417694,
-0.05030255392193794,
-0.7585380673408508,
0.7783978581428528,
-0.15636374056339264,
-0.3304520249366... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames - Syntax:
Example:
Object.getOwnPropertyNames(obj) | [
-0.7971174716949463,
0.32903411984443665,
-1.5563998222351074,
-0.6129745841026306,
-0.9895766973495483,
-1.8380529880523682,
0.2700578272342682,
0.4182372987270355,
-0.12940821051597595,
-0.378263384103775,
-0.8020129799842834,
0.5295723676681519,
-0.753544807434082,
-0.46907559037208557,... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames - Syntax - Parameters:
- `obj`: The object whose enumerable and non-enumerable properties are to be returned. | [
-0.7936431765556335,
0.5608214735984802,
-0.9974055290222168,
-0.336643785238266,
-0.7892670631408691,
-1.3424146175384521,
0.6888573169708252,
0.08693253248929977,
-0.11255048215389252,
-0.25764814019203186,
-1.2354519367218018,
0.8860570788383484,
-0.22068822383880615,
0.4809728860855102... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames - Syntax - Return value:
An array of strings that corresponds to the properties found directly in the given object. | [
-0.43678632378578186,
0.14831413328647614,
-0.6811655759811401,
0.11092426627874374,
-0.6707669496536255,
-1.701877474784851,
0.7676626443862915,
0.7683518528938293,
-0.2675354480743408,
-0.1321357637643814,
-0.9514656662940979,
1.0758357048034668,
-0.8603647351264954,
0.7652532458305359,
... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames - Description:
`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent... | [
-0.5813335180282593,
-0.46485501527786255,
-1.085245966911316,
0.2607139050960541,
0.06956128776073456,
-1.6741033792495728,
0.5944531559944153,
-0.16396325826644897,
-0.6029888987541199,
0.5593799352645874,
-0.4937252998352051,
0.24954508244991302,
-0.5319227576255798,
-0.0826528742909431... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames - Examples - Using Object.getOwnPropertyNames():
Example:
const arr = ["a", "b", "c"];
console.log(Object.getOwnPropertyNames(arr).sort());
// ["0", "1", "2", "length"]
// Array-like object
const obj = { 0: "a", 1: "b", 2: "c" };
console.log(Object.getOwnPro... | [
-0.2334206998348236,
-0.0833461806178093,
-0.5262887477874756,
-0.10374023020267487,
0.45313480496406555,
-0.6006904244422913,
0.05200892314314842,
0.5850088000297546,
-0.5458112955093384,
0.07462085038423538,
-0.8978937268257141,
0.39068982005119324,
-0.786484956741333,
0.1179260239005088... |
javascript/reference/global_objects/object/getownpropertynames/index.md | JavaScript - Global Objects - Object - getOwnPropertyNames - Examples - Get non-enumerable properties only:
This uses the `Array.prototype.filter()` function to remove the enumerable keys (obtained with `Object.keys()`) from a list of all keys (obtained with `Object.getOwnPropertyNames()`) thus giving only the non-enu... | [
-0.8998348712921143,
-0.08772853761911392,
-1.1521196365356445,
-0.305006206035614,
-0.5137662887573242,
-1.811782956123352,
-0.0049653686583042145,
0.24646888673305511,
-0.653526782989502,
0.9455440044403076,
-0.4891343414783478,
-0.07154884189367294,
-0.5866659879684448,
-0.3762351870536... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values:
The `Object.values()` static method returns an array of a given object's own enumerable string-keyed property values.
Example:
const object = {
a: "some string",
b: 42,
c: false,
};
console.log(Object.values(object));
// Expected output: Array ["some string", 42,... | [
-0.6605353951454163,
-0.4450036585330963,
-1.3776895999908447,
0.2046002447605133,
-0.08850616961717606,
-1.7635167837142944,
0.27942538261413574,
0.4994484484195709,
-0.22427673637866974,
-0.2005418837070465,
-0.3693898022174835,
0.5623951554298401,
0.5262828469276428,
-0.2539092004299164... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values - Syntax:
Example:
Object.values(obj) | [
0.0004980256198905408,
0.09931663423776627,
-1.264655590057373,
-0.5035855770111084,
-0.8609099984169006,
-1.9064737558364868,
0.7196472883224487,
0.7422708868980408,
0.01692930795252323,
-0.9160728454589844,
-0.33236515522003174,
0.41579723358154297,
0.02911505289375782,
-0.09889097511768... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values - Syntax - Parameters:
- `obj`: An object. | [
0.01753501035273075,
-0.046623121947050095,
-1.477509617805481,
-0.8104983568191528,
-0.5926133990287781,
-1.6049851179122925,
0.2964525520801544,
0.46216917037963867,
0.5443911552429199,
-0.8807266354560852,
-1.3496865034103394,
0.33542898297309875,
0.1018729954957962,
0.2704257071018219,... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values - Syntax - Return value:
An array containing the given object's own enumerable string-keyed property values. | [
-0.30534282326698303,
-0.06436365097761154,
-0.7120258808135986,
0.27004528045654297,
-0.7180718183517456,
-1.6150906085968018,
0.6515936851501465,
0.9316222071647644,
-0.2861877381801605,
-0.26796063780784607,
-0.708097517490387,
1.1354010105133057,
-0.5256114602088928,
0.8574044704437256... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values - Description:
`Object.values()` returns an array whose elements are values of enumerable string-keyed properties found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain ... | [
-0.6476567387580872,
-0.2884719967842102,
-0.9424746632575989,
0.5755711793899536,
0.03720963001251221,
-1.8462908267974854,
0.3754366338253021,
0.16278116405010223,
-0.7515872120857239,
0.16219556331634521,
0.011616352945566177,
0.7529926896095276,
0.17851004004478455,
-0.0875152722001075... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values - Examples - Using Object.values():
Example:
const obj = { foo: "bar", baz: 42 };
console.log(Object.values(obj)); // ['bar', 42]
// Array-like object
const arrayLikeObj1 = { 0: "a", 1: "b", 2: "c" };
console.log(Object.values(arrayLikeObj1)); // ['a', 'b', 'c']
// Arra... | [
0.2554967701435089,
0.22407586872577667,
-1.1080402135849,
0.25200483202934265,
-0.41620194911956787,
-1.5156019926071167,
0.17842301726341248,
-0.11155794560909271,
-0.06521163135766983,
-0.08399305492639542,
-0.1952911764383316,
-0.008159797638654709,
-0.04243015870451927,
-0.00141019362... |
javascript/reference/global_objects/object/values/index.md | JavaScript - Global Objects - Object - values - Examples - Using Object.values() on primitives:
Non-object arguments are coerced to objects. `undefined` and `null` cannot be coerced to objects and throw a `TypeError` upfront. Only strings may have own enumerable properties, while all other primitives return an empty a... | [
-0.5648850202560425,
0.28090015053749084,
-0.4100414216518402,
0.33221435546875,
-0.2809363901615143,
-2.271700620651245,
1.7546532154083252,
0.036098964512348175,
-0.07305367290973663,
0.20082181692123413,
-0.4998522698879242,
-0.7817391753196716,
-0.07949277758598328,
-0.938515305519104,... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen:
The `Object.isFrozen()` static method determines if an object is `frozen`.
Example:
const object = {
foo: 42,
};
console.log(Object.isFrozen(object));
// Expected output: false
Object.freeze(object);
console.log(Object.isFrozen(object));
// Expected output: true | [
-0.6383337378501892,
-0.7728399038314819,
-0.8519772887229919,
-0.21189962327480316,
-0.04451831057667732,
-1.958006501197815,
0.8631104230880737,
0.1812986433506012,
-0.03219369426369667,
0.31980329751968384,
-0.7177485823631287,
-0.9502565860748291,
0.6672199964523315,
0.2552655041217804... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen - Syntax:
Example:
Object.isFrozen(obj) | [
-0.24448686838150024,
0.23920206725597382,
-0.8608499765396118,
-0.5841242074966431,
-0.5384178161621094,
-2.2813186645507812,
1.0685652494430542,
0.637593150138855,
-0.10313598811626434,
-0.5012510418891907,
-0.5182534456253052,
-0.46193602681159973,
0.18690280616283417,
0.365030437707901... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen - Syntax - Parameters:
- `obj`: The object which should be checked. | [
-0.21960431337356567,
0.2370481640100479,
-1.218130111694336,
-0.7527260780334473,
0.04327845573425293,
-1.4819495677947998,
0.9343147873878479,
-0.15731070935726166,
0.05947994813323021,
0.10850837081670761,
-1.3099473714828491,
-0.370403915643692,
-0.05096600949764252,
1.153092622756958,... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen - Syntax - Return value:
A `Boolean` indicating whether or not the given object is frozen. | [
-0.6212794184684753,
-0.34680140018463135,
-0.6393930912017822,
-0.41192522644996643,
-0.4872228801250458,
-1.6034843921661377,
1.0187292098999023,
0.875088632106781,
-0.18561232089996338,
-0.4521028697490692,
-1.0862469673156738,
0.2511675953865051,
0.3383587598800659,
1.057246208190918,
... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen - Description:
An object is frozen if and only if it is not extensible, all its properties are non-configurable, and all its data properties (that is, properties which are not accessor properties with getter or setter components) are non-writable. | [
-0.6313108205795288,
0.05923861637711525,
-0.5111774206161499,
0.20407885313034058,
-0.07456906884908676,
-2.1825859546661377,
0.3455680310726166,
0.7550640106201172,
0.47704389691352844,
-0.2510298788547516,
-0.5349960327148438,
-0.4911763668060303,
-0.19110915064811707,
0.425799608230590... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen - Examples - Using Object.isFrozen:
Example:
// A new object is extensible, so it is not frozen.
Object.isFrozen({}); // false
// An empty object which is not extensible
// is vacuously frozen.
const vacuouslyFrozen = Object.preventExtensions({});
Object.isFrozen(vacuo... | [
-0.6314448118209839,
-0.0013774175895377994,
-0.003616711124777794,
0.3575438857078552,
0.6283183097839355,
-0.7276132702827454,
0.5283362865447998,
0.6382486820220947,
-0.342937707901001,
-0.035352591425180435,
-0.48100125789642334,
-0.3505442142486572,
-0.9278078675270081,
0.437987953424... |
javascript/reference/global_objects/object/isfrozen/index.md | JavaScript - Global Objects - Object - isFrozen - Examples - Non-object argument:
In ES5, if the argument to this method is not an object (a primitive), then it will cause a `TypeError`. In ES2015, it will return `true` without any errors if a non-object argument is passed, since primitives are, by definition, immutab... | [
-0.3324872553348541,
-0.4013044536113739,
-0.43250784277915955,
-0.06359974294900894,
0.04570813104510307,
-2.7614142894744873,
1.3677623271942139,
0.901268482208252,
-0.08405783772468567,
0.21378782391548157,
-0.13045835494995117,
-1.027698040008545,
0.07206850498914719,
-0.03903602063655... |
javascript/reference/global_objects/object/is/index.md | JavaScript - Global Objects - Object - is:
The `Object.is()` static method determines whether two values are the same value.
Example:
console.log(Object.is("1", 1));
// Expected output: false
console.log(Object.is(NaN, NaN));
// Expected output: true
console.log(Object.is(-0, 0));
// Expected output: false
const ... | [
-1.1055587530136108,
-0.7834023833274841,
-1.302693247795105,
0.21223533153533936,
-0.0763506144285202,
-1.9091349840164185,
0.01788577437400818,
0.4998161196708679,
0.12365617603063583,
0.15842466056346893,
-1.2446999549865723,
-0.5754961371421814,
0.6812381148338318,
-0.22726577520370483... |
javascript/reference/global_objects/object/is/index.md | JavaScript - Global Objects - Object - is - Syntax:
Example:
Object.is(value1, value2) | [
-0.003057152032852173,
-0.13085950911045074,
-0.7124162912368774,
-0.36458754539489746,
-0.7933605313301086,
-2.194293260574341,
0.1488650143146515,
0.8011402487754822,
0.14003820717334747,
-1.2062525749206543,
-1.0970531702041626,
-0.18970268964767456,
0.18114134669303894,
-0.070434458553... |
javascript/reference/global_objects/object/is/index.md | JavaScript - Global Objects - Object - is - Syntax - Parameters:
- `value1`: The first value to compare.
- `value2`: The second value to compare. | [
-0.0834825411438942,
0.22567854821681976,
-0.7884424924850464,
-0.33287808299064636,
-0.4984923303127289,
-1.5995819568634033,
0.6347722411155701,
0.9610657691955566,
0.6113234758377075,
-0.7115355730056763,
-1.1891932487487793,
-0.24913719296455383,
-0.05203244835138321,
0.222339347004890... |
javascript/reference/global_objects/object/is/index.md | JavaScript - Global Objects - Object - is - Syntax - Return value:
A boolean indicating whether or not the two arguments are the same value. | [
-0.6821250915527344,
-0.5584218502044678,
-0.7371503710746765,
-0.046480853110551834,
-0.8866278529167175,
-1.9700920581817627,
0.8347418308258057,
0.6636689901351929,
-0.21606330573558807,
-0.39778584241867065,
-1.3472248315811157,
0.3786439001560211,
0.42180415987968445,
0.66408658027648... |
javascript/reference/global_objects/object/is/index.md | JavaScript - Global Objects - Object - is - Description:
`Object.is()` determines whether two values are the same value. Two values are the same if one of the following holds:
- both `undefined`
- both `null`
- both `true` or both `false`
- both strings of the same length with the same characters in the same order
- ... | [
-0.3011278808116913,
-0.23848874866962433,
-0.7498679757118225,
0.5797497034072876,
0.49477818608283997,
-0.9968514442443848,
0.9099041819572449,
0.4703626036643982,
-0.6306255459785461,
0.3248230218887329,
-0.9511910080909729,
-1.085351586341858,
0.2416781187057495,
0.1416347324848175,
... |
javascript/reference/global_objects/object/is/index.md | JavaScript - Global Objects - Object - is - Examples - Using Object.is():
Example:
// Case 1: Evaluation result is the same as using ===
Object.is(25, 25); // true
Object.is("foo", "foo"); // true
Object.is("foo", "bar"); // false
Object.is(null, null); // true
Object.is(undefined, undefined); // true
Object.is(windo... | [
-0.3422154188156128,
0.025137968361377716,
-0.9424311518669128,
-0.2481524497270584,
-0.33456578850746155,
-2.387593984603882,
0.3250736892223358,
0.3065146803855896,
0.2703937888145447,
0.1516023427248001,
-1.176560878753662,
-0.37599653005599976,
0.12673954665660858,
0.1261572539806366,
... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable:
The `propertyIsEnumerable()` method of `Object` instances returns a boolean indicating whether the specified property is this object's enumerable own property.
Example:
const object = {};
const array = [];
object.foo = 42;
array[0] = 42;
console.log(objec... | [
-0.3299138844013214,
-0.5846604108810425,
-0.7168013453483582,
0.5222898125648499,
-0.6838393807411194,
-2.183269739151001,
0.293613463640213,
0.3567870557308197,
0.2583811283111572,
0.5512651205062866,
-0.7831977605819702,
0.7522357106208801,
0.0877022072672844,
-0.35267603397369385,
0.... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Syntax:
Example:
propertyIsEnumerable(prop) | [
-0.3558313846588135,
0.3605627119541168,
-0.19079668819904327,
-0.401137113571167,
-1.190172791481018,
-2.379453420639038,
0.5466873049736023,
0.9871314167976379,
0.16414275765419006,
0.012987869791686535,
-0.7664310932159424,
0.8235993385314941,
-0.17906200885772705,
-0.4597131311893463,
... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Syntax - Parameters:
- `prop`: The name of the property to test. Can be a string or a `Symbol`. | [
-0.6081959009170532,
-0.10729051381349564,
-0.2372409552335739,
-0.6713054776191711,
-0.5853602886199951,
-2.1747283935546875,
0.2918928563594818,
0.6391445398330688,
0.36538562178611755,
-0.0330384261906147,
-1.3902549743652344,
1.0209968090057373,
-0.4486798942089081,
0.02054663375020027... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Syntax - Return value:
A boolean value indicating whether the specified property is enumerable and is the object's own property. | [
-0.37993884086608887,
0.16186076402664185,
-0.2721579074859619,
0.44318312406539917,
-0.8786698579788208,
-2.304117441177368,
0.8437754511833191,
0.6123629212379456,
0.19212482869625092,
0.11788298934698105,
-1.1703659296035767,
1.5599416494369507,
-0.2378893792629242,
0.4688449501991272,
... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Description:
All objects that inherit from `Object.prototype` (that is, all except `null`-prototype objects) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of th... | [
-1.4569896459579468,
-0.2248404622077942,
-0.20833896100521088,
0.31408974528312683,
-0.5618794560432434,
-2.8388020992279053,
0.7022354602813721,
0.6888237595558167,
-0.1290079951286316,
-0.22771838307380676,
-1.0699512958526611,
0.6119644045829773,
-0.25096386671066284,
-0.13778388500213... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Examples - Using propertyIsEnumerable():
The following example shows the use of `propertyIsEnumerable()` on objects and arrays.
Example:
const o = {};
const a = [];
o.prop = "is enumerable";
a[0] = "is enumerable";
o.propertyIsEnumerable("prop"); // true... | [
-0.3482345938682556,
0.4792839288711548,
-0.41491347551345825,
0.163663849234581,
-0.7955251932144165,
-2.041628122329712,
0.7522846460342407,
0.8055880665779114,
0.3810879588127136,
0.3854379951953888,
-0.7202538251876831,
0.7717289924621582,
0.2468070387840271,
-0.7732177972793579,
0.2... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Examples - User-defined vs. built-in objects:
Most built-in properties are non-enumerable by default, while user-created object properties are often enumerable, unless explicitly designated otherwise.
Example:
const a = ["is enumerable"];
a.propertyIsEnu... | [
-0.4264885485172272,
-0.19058533012866974,
-0.600055992603302,
0.277952641248703,
-0.21193665266036987,
-2.1170239448547363,
-0.08685492724180222,
0.4461585283279419,
0.6652199625968933,
0.843235194683075,
-0.2928067147731781,
0.7819738984107971,
-0.02259184792637825,
-0.6195526123046875,
... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Examples - Direct vs. inherited properties:
Only enumerable own properties cause `propertyIsEnumerable()` to return `true`, although all enumerable properties, including inherited ones, are visited by the `for...in` loop.
Example:
const o1 = {
enumerabl... | [
-0.7358811497688293,
0.7933699488639832,
-0.18115130066871643,
0.3051603138446808,
-0.594823956489563,
-2.763044595718384,
0.09530246257781982,
0.3832860589027405,
0.1093805730342865,
0.7227764129638672,
-0.24134770035743713,
0.5444180965423584,
-0.36676445603370667,
-0.3491632640361786,
... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Examples - Testing symbol properties:
`Symbol` properties are also supported by `propertyIsEnumerable()`. Note that most enumeration methods only visit string properties; enumerability of symbol properties is only useful when using `Object.assign()` or spre... | [
-0.9932533502578735,
0.0462527833878994,
-0.08118009567260742,
-0.25477728247642517,
-0.5564836859703064,
-2.4869332313537598,
0.5809096097946167,
0.5269919037818909,
0.23769965767860413,
0.5909909009933472,
-1.2295712232589722,
0.4558738172054291,
0.09117595851421356,
-0.505817711353302,
... |
javascript/reference/global_objects/object/propertyisenumerable/index.md | JavaScript - Global Objects - Object - propertyIsEnumerable - Examples - Usage with null-prototype objects:
Because `null`-prototype objects do not inherit from `Object.prototype`, they do not inherit the `propertyIsEnumerable()` method. You must call `Object.prototype.propertyIsEnumerable` with the object as `this` i... | [
-1.2101712226867676,
0.2755071222782135,
-0.4896147549152374,
0.23283089697360992,
-0.4697417914867401,
-2.2860658168792725,
-0.09538774192333221,
0.6976678371429443,
0.17122933268547058,
0.2884427011013031,
-1.1567299365997314,
0.40582820773124695,
-0.22040456533432007,
-0.341639339923858... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor:
The `Object.getOwnPropertyDescriptor()` static method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain). The object returned is mut... | [
-1.2745696306228638,
-0.6413798928260803,
-1.5035072565078735,
-0.33291614055633545,
-0.29690980911254883,
-1.481266736984253,
-0.194332554936409,
0.25626692175865173,
0.5015080571174622,
0.5049896836280823,
-0.9107193350791931,
0.6775562167167664,
0.1359778642654419,
-0.0367199145257473,
... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor - Syntax:
Example:
Object.getOwnPropertyDescriptor(obj, prop) | [
-1.2131638526916504,
0.15364885330200195,
-1.2835825681686401,
-0.7664958834648132,
-1.0437865257263184,
-1.653698205947876,
-0.30119580030441284,
0.4038031995296478,
0.4304995834827423,
-0.28884315490722656,
-0.6765589118003845,
0.3498252332210541,
-0.28220105171203613,
-0.139846935868263... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor - Syntax - Parameters:
- `obj`: The object in which to look for the property.
- `prop`: The name or `Symbol` of the property whose description is to be retrieved. | [
-1.0435353517532349,
-0.18188999593257904,
-1.2403031587600708,
-0.5039790272712708,
-0.43519502878189087,
-1.3361141681671143,
0.004816805012524128,
-0.1688269078731537,
0.4796008765697479,
-0.26142653822898865,
-1.2336325645446777,
0.7444393038749695,
-0.7021155953407288,
0.4612718224525... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor - Syntax - Return value:
A property descriptor of the given property if it exists on the object, `undefined` otherwise. | [
-1.0332133769989014,
-0.08075937628746033,
-0.5596411824226379,
0.3008146286010742,
-0.7442154884338379,
-1.234821081161499,
0.5926024913787842,
0.7083987593650818,
0.3931811451911926,
0.09194567799568176,
-0.8900437355041504,
0.7786842584609985,
-0.3943743109703064,
0.5322315096855164,
... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor - Description:
This method permits examination of the precise description of a property. A property in JavaScript consists of either a string-valued name or a `Symbol` and a property descriptor. Further information about property descriptor types and thei... | [
-1.4346592426300049,
-0.5323134660720825,
-1.4007775783538818,
0.30855467915534973,
-0.16373492777347565,
-1.8219858407974243,
-0.06422286480665207,
0.25063401460647583,
0.7231917381286621,
-0.09161924570798874,
-1.0662697553634644,
0.6855961084365845,
-0.962462306022644,
0.026769353076815... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor - Examples - Using Object.getOwnPropertyDescriptor():
Example:
let o, d;
o = {
get foo() {
return 17;
},
};
d = Object.getOwnPropertyDescriptor(o, "foo");
console.log(d);
// {
// configurable: true,
// enumerable: true,
// get: [Function: ... | [
-0.5965344905853271,
-0.16108791530132294,
-1.453872799873352,
-0.2091635763645172,
-0.7378919720649719,
-1.2651368379592896,
0.5367372035980225,
0.5568920373916626,
-0.2098858654499054,
0.08785966783761978,
-0.6795948147773743,
0.31139472126960754,
-0.7327284812927246,
0.33259305357933044... |
javascript/reference/global_objects/object/getownpropertydescriptor/index.md | JavaScript - Global Objects - Object - getOwnPropertyDescriptor - Examples - Non-object coercion:
In ES5, if the first argument to this method is not an object (a primitive), then it will cause a `TypeError`. In ES2015, a non-object first argument will be coerced to an object at first.
Example:
Object.getOwnProperty... | [
-0.30051225423812866,
-0.2903515100479126,
-0.120799221098423,
0.009952705353498459,
-0.27395308017730713,
-1.727798342704773,
0.3888956606388092,
0.7204312086105347,
0.07308556884527206,
0.8091806769371033,
-0.3758075535297394,
-0.9153034090995789,
-0.506997287273407,
-0.8677119612693787,... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries:
The `Object.entries()` static method returns an array of a given object's own enumerable string-keyed property key-value pairs.
Example:
const object = {
a: "some string",
b: 42,
};
for (const [key, value] of Object.entries(object)) {
console.log(`${key}: ${valu... | [
-0.155119851231575,
-0.6333288550376892,
-1.1402093172073364,
0.3965948224067688,
0.10901328176259995,
-1.7158973217010498,
0.4691154956817627,
0.273897260427475,
-0.14990979433059692,
0.0751686543226242,
-0.36409488320350647,
0.5823730826377869,
0.32514503598213196,
-0.015395522117614746,... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Syntax:
Example:
Object.entries(obj) | [
0.438592791557312,
-0.30184903740882874,
-1.1615206003189087,
-0.27812597155570984,
-0.8896051049232483,
-2.3200488090515137,
0.49364131689071655,
0.4026380181312561,
0.03269597142934799,
-0.6099546551704407,
-0.4354633092880249,
0.03692450374364853,
0.06004662811756134,
0.1418347805738449... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Syntax - Parameters:
- `obj`: An object. | [
0.3116663992404938,
-0.19516955316066742,
-1.488480567932129,
-0.6915948390960693,
-0.4766301214694977,
-1.7197867631912231,
0.23450656235218048,
0.379495233297348,
0.5463203191757202,
-0.8074707984924316,
-1.4555326700210571,
0.1287146806716919,
0.10506915301084518,
0.4736047387123108,
... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Syntax - Return value:
An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. | [
-0.23935537040233612,
0.09330420941114426,
-0.8710225224494934,
0.6581981778144836,
-0.419987291097641,
-1.1444545984268188,
1.194172978401184,
0.7335383892059326,
-0.39857831597328186,
-0.14723658561706543,
-0.8611425757408142,
1.1118251085281372,
-0.6343124508857727,
0.66307133436203,
... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Description:
`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates ... | [
-0.261526882648468,
-0.41891536116600037,
-0.9954032301902771,
0.6573706865310669,
-0.030011842027306557,
-2.0544321537017822,
0.3887757658958435,
0.015268867835402489,
-0.6097827553749084,
0.38328468799591064,
-0.1714765876531601,
0.6293104887008667,
0.08340425789356232,
0.020771162584424... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Examples - Using Object.entries():
Example:
const obj = { foo: "bar", baz: 42 };
console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ]
const arrayLike = { 0: "a", 1: "b", 2: "c" };
console.log(Object.entries(arrayLike)); // [ ['0', 'a'], ['1', 'b'], ['2... | [
0.5182697176933289,
0.16577917337417603,
-0.9999575614929199,
-0.3253803551197052,
-0.304042249917984,
-1.805378794670105,
-0.49608364701271057,
0.09406760334968567,
0.10777710378170013,
0.06318281590938568,
-0.6026069521903992,
-0.6619199514389038,
-0.014372133649885654,
0.612914621829986... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Examples - Using Object.entries() on primitives:
Non-object arguments are coerced to objects. `undefined` and `null` cannot be coerced to objects and throw a `TypeError` upfront. Only strings may have own enumerable properties, while all other primitives return an empty... | [
-0.2714882493019104,
0.1298111230134964,
-0.5654531121253967,
0.30212992429733276,
-0.39102086424827576,
-2.5289885997772217,
1.6297796964645386,
-0.09762156754732132,
0.1351841241121292,
0.3944004476070404,
-0.7034971117973328,
-0.7689796090126038,
-0.20469626784324646,
-0.791464567184448... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Examples - Converting an Object to a Map:
The `Map()` constructor accepts an iterable of `entries`. With `Object.entries`, you can easily convert from `Object` to `Map`:
Example:
const obj = { foo: "bar", baz: 42 };
const map = new Map(Object.entries(obj));
console.lo... | [
0.4280608296394348,
-0.21519175171852112,
-0.9878076910972595,
0.2131093591451645,
-0.1326594352722168,
-2.6068201065063477,
-0.0072767180390655994,
-0.45716947317123413,
0.12438338994979858,
0.28861814737319946,
-0.47732844948768616,
-0.1328074038028717,
0.6623444557189941,
-0.08643123507... |
javascript/reference/global_objects/object/entries/index.md | JavaScript - Global Objects - Object - entries - Examples - Iterating through an Object:
Using array destructuring, you can iterate through objects easily.
Example:
// Using for...of loop
const obj = { a: 5, b: 7, c: 9 };
for (const [key, value] of Object.entries(obj)) {
console.log(`${key} ${value}`); // "a 5", "... | [
0.6040363311767578,
-0.057409241795539856,
-0.9214970469474792,
0.6447537541389465,
-0.07640261203050613,
-1.7816882133483887,
0.14439283311367035,
-0.45028847455978394,
-0.042157821357250214,
0.22062687575817108,
-0.10123487561941147,
-0.7362255454063416,
-0.2998589873313904,
0.4134075641... |
javascript/reference/global_objects/object/getownpropertysymbols/index.md | JavaScript - Global Objects - Object - getOwnPropertySymbols:
The `Object.getOwnPropertySymbols()` static method returns an array of all symbol properties found directly upon a given object.
Example:
const object = {};
const a = Symbol("a");
const b = Symbol.for("b");
object[a] = "localSymbol";
object[b] = "globalS... | [
-0.4686910808086395,
-0.20382346212863922,
-1.4743486642837524,
-0.2610461711883545,
-0.3143225908279419,
-1.839929461479187,
-0.2190662920475006,
0.4887669086456299,
0.33283814787864685,
0.23574885725975037,
-0.8562264442443848,
0.9430779814720154,
0.21360687911510468,
-0.0654157921671867... |
javascript/reference/global_objects/object/getownpropertysymbols/index.md | JavaScript - Global Objects - Object - getOwnPropertySymbols - Syntax:
Example:
Object.getOwnPropertySymbols(obj) | [
-0.8003692626953125,
0.518731415271759,
-1.2860785722732544,
-0.7481761574745178,
-1.0209097862243652,
-2.10064959526062,
0.07119157165288925,
0.7949250340461731,
-0.029216885566711426,
-0.3124513328075409,
-0.8728359341621399,
0.7045987248420715,
-0.4295567572116852,
-0.3915219008922577,
... |
javascript/reference/global_objects/object/getownpropertysymbols/index.md | JavaScript - Global Objects - Object - getOwnPropertySymbols - Syntax - Parameters:
- `obj`: The object whose symbol properties are to be returned. | [
-0.7950075268745422,
0.7030501365661621,
-1.334228754043579,
-0.6705849766731262,
-0.5802049040794373,
-1.6704065799713135,
0.34500861167907715,
0.7116546034812927,
-0.10570195317268372,
-0.25684407353401184,
-1.3260581493377686,
0.8901475071907043,
-0.08152622729539871,
0.8050265908241272... |
javascript/reference/global_objects/object/getownpropertysymbols/index.md | JavaScript - Global Objects - Object - getOwnPropertySymbols - Syntax - Return value:
An array of all symbol properties found directly upon the given object. | [
-0.19547250866889954,
0.4250165522098541,
-0.7727242112159729,
0.039096228778362274,
-0.7298474311828613,
-1.7663800716400146,
0.6436163187026978,
1.3670271635055542,
0.07994155585765839,
-0.05552510917186737,
-0.8465874791145325,
1.1827878952026367,
-0.25946658849716187,
0.851935267448425... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.