Questions tagged [object-properties]

117 questions
1
vote
0 answers

Dynamically Create/Remove Kivy Properties and Bind Them to Labels in ViewClass

Good day, I have a traditional Kivy viewclass "RecycleViewRow", which takes rv.data [{'id': "some_ID",'status': "Good, 'invoiceNumber': "1"},{'id': "some_other_ID",'status': "bad, 'invoiceNumber': "24"}]and with properly-named properties in both…
autopy
  • 11
  • 2
1
vote
2 answers

Is there a way to find the sibling value of a nested object's property?

Here's my structure: var obj = { apple: { name: "Apple Juice", description: "", }, orange: { name: "Orange Juice", description: "", } } I want to find out the description of apple or orange by its name without using the…
pr -
  • 240
  • 2
  • 9
1
vote
0 answers

Protege inference on Object property assertions

I am trying to build a simple ontology to check how class expressions are inferred in protege, using the reasoner Hermit 1.4.3. The ontology is as follows: There are two classes Robot and Head, one object property hasPart and a class expression that…
epd
  • 11
  • 4
1
vote
1 answer

What does a javascript object dataset attribute combined with a bitwise or and 0 do?

I came across this pen when searching for a way to make a textarea auto-expand with input: https://codepen.io/vsync/pen/frudD. The code includes the line var minRows = elm.getAttribute('data-min-rows')|0, rows; I do not understand what the bitwise…
1
vote
0 answers

console.log(object) shows property and its value, but that property is not actually a key?

I have an object with multiple properties, one of which is 'lane' with a value of 1. console.log(myObject), shows the property and its value are there. However, if I try to access it myObject.lane, it is'undefined'. Also - if I print the keys of…
NicoWheat
  • 2,157
  • 2
  • 26
  • 34
1
vote
1 answer

Picking correct enum type to access object nested property

It is quite common case for me but yet I didn't stumble upon easy solution for this. I have following enums (there are more values for each enum but for sake of simplicity I trimmed them down to two. Also note that same enum keys and values in every…
1
vote
1 answer

Fake object with Dynamic properties

I am trying to simulate a get request where the speed will change. export const fakeData = { timestamp: 1567606228, speed: generatespeed() }; function generatespeed () { return Math.floor(Math.random() * 100); } To…
TommyD
  • 913
  • 3
  • 17
  • 32
1
vote
1 answer

Difference between Object property accessing in Javascript using key or loop

I have a linear(or single dimension) object with more than 1000 properties within a single record. I have to traverse more than 10000 records. It is possible that sometime the required property doesn't contain by the object within a single record. I…
sagar
  • 732
  • 1
  • 6
  • 25
1
vote
1 answer

Web Components: Is there an equivalent to attributeChangedCallback for properties?

You're not supposed to put rich data (objects, arrays, functions) in HTML element attributes. Instead, it's suggested to only put rich data in properties (according to the Google custom elements best practices article). I need to run actions when…
Benny Hinrichs
  • 1,393
  • 9
  • 17
1
vote
1 answer

HTML String on Object Property Won't Update

I have an object constructor that sets some properties, and later uses them to concatenate a string to write to the DOM. I can see that this works in some cases, but not in others. function Fighter(name, level, attackPts, defencePts, imgSource) { …
Kevin H.
  • 318
  • 2
  • 15
1
vote
1 answer

How do I get a Negative Object Property Assertion inferred?

I am working in an ontology, and I have the following swrl rule: User(?u) ^ Project(?p) ^ isRelatedTo(?u, ?p) ^ isMemberOf(?u, ?p) -> verifiedAssociation(?u, ?p) And I would like to know when a Negative Object Property Assertion happens (when…
1
vote
1 answer

merge props from nested objects as one single object using es6

Suppose we are given the following: const Patients = { P1: { "name": "Person1", "profession": "Student", "gender": "Male", "type": "Patient", "Doctors": {...} }, P2: { "name": "Person2", "profession":…
1
vote
5 answers

Merge specific prop of objects into one using es6?

This is by far the most common question asked in SO, however, all in all, the questions asked refers to merging two whole objects. In my case, it's quite different. Suppose I'm given: const P1 = { "name" : "Person1", "profession" …
Doe
  • 193
  • 4
  • 14
1
vote
2 answers

Setting the key of an object property that is an array

Just today I noticed a strange behavior in an object model that was previously working just fine (I have checked everything possible and nothing about its configuration has changed, so I am suspecting a change to PHP version and wondering if anyone…
DeaconDesperado
  • 9,977
  • 9
  • 47
  • 77
1
vote
3 answers

JavaScript: Append object properties as child elements

I have an array of object and I'm trying to create HTML elements for each object and for each object's property, but got stuck, when I try to loop through containerDiv and appending object's properties as children elements. I want to create a div…