Skip to main content

All Questions

Tagged with
208 questions with no upvoted or accepted answers
7 votes
0 answers
988 views

JS: Object.defineProperty() and Proxy

What's the difference between Object.defineProperty() and Proxy? On my view they do really the same in essence being useful only for implementation of reactivity, validation and defaults. So it just ...
SerG's user avatar
  • 1,313
4 votes
1 answer
2k views

Defining setter for Ember Object property

I have an Ember.Object Foo with property message: Foo = Ember.Object.extend({ message: null When this.set('message', value) is executed, I want to modify the value variable before it is set on ...
dylanmensaert's user avatar
3 votes
0 answers
514 views

NSPredicate filtering object property that is an array of strings

I'm trying to figure out NSPredicate. The class below is made up data. I am trying to search an array of objects. Within an object, I want to search a property that is an array of strings: ...
P.Festus's user avatar
3 votes
0 answers
1k views

Make an object non-extensible to developer but extensible internally with ES5

I want to make it so that a new object is non-extensible to the developer/user but still be able to add properties to itself via its own methods. I've tried a number of things and done a fair amount ...
Xotic750's user avatar
  • 23.2k
2 votes
0 answers
317 views

Transform JavaScript object by clearing, adding and removing properties

Here are the instructions for what I am supposed to do: Implement a function accepting 2 arguments: state and actions. The function should change the state basing on the given actions array. state ...
Dukeofduke's user avatar
2 votes
0 answers
125 views

How do accessor properties work inside in Javascript?

I have noticed that using accessor properties instead of data properties in js then the object is forced to store the value of the property twice: let obj = { get propName(){ return this....
Arayik's user avatar
  • 21
2 votes
1 answer
594 views

Is there a way to generate @jsonignore annotation for schema generated via avro?

Suppose I generate a domain object with several properties.I want to generate @jsonignore annotation for one of the object properties in the class defn.
manoman's user avatar
  • 21
2 votes
1 answer
81 views

Accessing Data of Linked Objects by a Property Chain in a Single Variable

I am trying to access data of two linked objects by using the chain of the relevant properties. However, the chain of properties is only available in a single variable and that seems to bother ...
Tian Ren's user avatar
2 votes
1 answer
124 views

What are other ways of creating object properties in JS with enumerable set to false by default?

Enumerable properties are those properties whose internal [[Enumerable]] flag is set to true, which is the default for properties created via simple assignment or via a property initializer (...
Marina Dunst's user avatar
2 votes
1 answer
109 views

parseInt duplicates object property in JavaScript

After for(var i=0; i < data.length; i++) { data[i].dummyProp = parseInt(data[i].dummyProp); } i get double property name: data: Array[1] 0: Object dummyProp: NaN dummyProp: "" ...
Kozuch's user avatar
  • 2,282
2 votes
2 answers
174 views

How to get ALL properties of an object without using for-in loop in JavaScript (Firefox)?

I was trying to get/count properties of an object and found this QaA, and this cross-browser solution. However, Object.keys does not always return the same as with for-in loop. var obj = {foo: "foo",...
user1643156's user avatar
  • 4,497
2 votes
1 answer
1k views

Binding to object not property

While using a converter, I want to bind to the entire object and send it to the converter to use, rather than binding to each of the individual properties, so I can do this: Order thisOrder = (Order)...
Neil's user avatar
  • 3,140
2 votes
0 answers
2k views

Javascript array with custom properties

I have started using a techique for indexing arrays by adding a key property to the array. This is useful if you wish to preserve the order of an array but also do quick lookups on it (especially when ...
mummybot's user avatar
  • 2,750
2 votes
1 answer
206 views

Are these subproperties? What is the correct term?

I have a question over terminology. In JavaScript, I have an array made up of properties that are themselves objects, delimited by braces. Would the properties of the object properties of the array ...
Custer's user avatar
  • 119
2 votes
2 answers
102 views

how does it work element.style["background-color"]

There is not property name in element.style object. But when we reach it by bracket notation it returns string value. for example Object.keys(document.body.style).includes("background-color")...
mustafa kemal tuna's user avatar

15 30 50 per page
1
2 3 4 5
14