All Questions
Tagged with object properties
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 ...
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 ...
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: ...
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 ...
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 ...
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....
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.
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 ...
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 (...
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: ""
...
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",...
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)...
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 ...
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 ...
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")...