Skip to main content

All Questions

Tagged with
1 vote
2 answers
66 views

Get value from Javascript object using for loop

I am having an issue getting accessing the value from a key of an object. I am passing in this.fields which has 2 objects in an array like, [{'First Name': 'firstName'}, {'Last Name': 'lastName'}] ...
Shawn's user avatar
  • 2,425
29 votes
2 answers
5k views

What is an "internal slot" of an object in JavaScript?

I've tried to understand ECMAScript 2015 specification in one point: Internal Slots of Objects. But this section appeared very unclear to me, especially this sentence: Internal slots correspond to ...
BairDev's user avatar
  • 3,095
1 vote
3 answers
79 views

Combine object and arrays

I'm trying to write a function that takes an array of objects, and an unlimited number of arrays, and combines them to form a single object. The inputs would follow this pattern: let x = [{ name: '...
droberts's user avatar
3 votes
1 answer
155 views

Does ECMA6 do away with using prototype syntax as a best practice in JavaScript?

Example, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes JavaScript classes are introduced in ECMAScript 6 and are syntactical sugar over JavaScript's existing ...
johnny's user avatar
  • 19.6k
0 votes
3 answers
113 views

How can I make an object property be both a function and a variable in Javascript?

I have seen* something where a certain key can be called both as a variable and as a function. The variable would return a value, the function would do something functiony. obj.test // E.g. 16 obj....
Redsandro's user avatar
  • 11.3k
38 votes
5 answers
13k views

Difference between Configurable and Writable attributes of an Object

I saw the following regarding javascript, object data property attributes — 
Configurable: Specifies whether the property can be deleted or changed. — Enumerable: Specifies whether the property can ...
Bravo's user avatar
  • 8,979
7 votes
2 answers
301 views

MDN "Object.is" alternative proposal

I have read the MDN page on the "Object.is" method. It gives an alternative code for the browsers that do not provide this method: if (!Object.is) { Object.is = function(v1, v2) { if (v1 =...
Clem's user avatar
  • 87
7 votes
3 answers
3k views

JavaScript Symbol type: (non-string object keys)

What is the "Symbol" javascript type as mentioned in this ECMAScript 6 draft specification? To quote the spec: The Symbol type is the set of all non-String values that may be used as the ...
Web_Designer's user avatar
  • 73.9k
2 votes
2 answers
352 views

Problems with extending regular Objects to support ES5 Array capabilities

I have long ago been willing to get the line between native Arrays and regular Objects totally blurred, not only extending Object with the same capabilities as Arrays got in ES5, but bundle up with my ...
Zoltan Ludanyi's user avatar
86 votes
10 answers
121k views

How to create a derived class in JavaScript?

I have a base class: function Monster() { this.health = 100; } Monster.prototype.growl = function() { console.log("Grr!"); } That I want to extend and create another class with: function ...
Lucas Penney's user avatar
  • 2,664

15 30 50 per page
1
69 70 71 72
73