Questions tagged [object-properties]

117 questions
3
votes
2 answers

Why does accessing a property work even if I include an unnecessary backslash while accessing?

The question is how is adding an unnecessary backslash a valid key while accessing the property? And by the way it works if I remove the backslash at the key name while accessing as well. 'use strict'; let x = { "2nu^mb$er": "number as…
Manoj Bharadwaj
  • 191
  • 1
  • 1
  • 10
3
votes
1 answer

OWL Protegé: Using the same Object property for different Domains/Ranges

I'm using Protegé to create an OWL ontology and I have Question. I have the following set up: (relation1) ClassA isTriggeredBy ClassB (relation1) ClassC isTriggeredBy ClassD Nevertheless the relation should be either (ClassA,…
PLS
  • 231
  • 2
  • 6
  • 14
3
votes
3 answers

Can't list window.document properties - why?

Running this JavaScript lists in Firefox 60.2 only one property ("location"), but there are many others, like "document.title" etc. window.console.log("List props: " + Object.keys(window.document).sort().join(' / ')); Why is it this way? Safety?…
3
votes
1 answer

Ontology Object Properties Inheritance

I have developed an Arabic ontology about chest diseases using Protege 5.2.0, the ontology has a class Disease and a class Symptom. The object property between the previous two classes is has_symptom which the domain of it is Disease and the range…
Ali Alnader
  • 193
  • 1
  • 14
3
votes
2 answers

Why does accessing a non-existent object property result in `undefined` instead of throwing a `ReferenceError`?

When I try to use an undeclared variable I get ReferenceError: console.log(a); // Uncaught ReferenceError: a is not defined I could use a variable first and define it later and it won’t be a problem due to hoisting. console.log(a); //…
dogant
  • 1,376
  • 1
  • 10
  • 23
3
votes
1 answer

Identify and filter Navigation Properties in a Entity Data Object

(Environment: EF6 FW4.5 Webforms Application with N-Tier architecture) I am creating a function to run in my UI layer for debug to loop and write all entity properties to the page. It works except that I get an error when it gets to a Navigation…
Ted
  • 123
  • 3
  • 13
3
votes
5 answers

Variable Variables Pointing to Arrays or Nested Objects

Is it possible to create a variable variable pointing to an array or to nested objects? The php docs specifically say you cannot point to SuperGlobals but its unclear (to me at least) if this applies to arrays in general. Here is my try at the…
K-2052
  • 197
  • 4
  • 10
2
votes
2 answers

Can I create a PHP class that can't have properties added to it dynamically at run-time?

Take this class for an example: name = $name; $this->dob = $dob; } } $potts = new Person('Matt',…
Matt
  • 9,068
  • 12
  • 64
  • 84
2
votes
2 answers

Modify json properties from string dynamically

I have JSON object var a = { a: { b: 10, c: 10 } } I want a method that can change JSON object dynamically. Suppose when i supply object , string and a value to method it should return updated JSON object change(a, 'a.b', 30) change method is as…
2
votes
2 answers

How can I get Vue.js to be reactive for changes to dynamically added array properties?

In Vue.js, I have a data object with dynamically added/edited properties that are themselves arrays. For example, the property starts out as follows: data: function () { return { vals: {} }; } And over time, through various button…
HartleySan
  • 7,404
  • 14
  • 66
  • 119
2
votes
5 answers

How to filter an object of objects efficiently?

This question has been proposed many times in SO, but they all refer to an array of objects. In my case, I would like to filter an object of objects. Say I have this object: "Users": { "w14FKo72BieZwbxwUouTpN7UQm02": { "name": "Naseebullah…
Doe
  • 193
  • 4
  • 14
2
votes
1 answer

PHP: change order of object properties

Regarding PHP, is there a way to change the order of object properties? class o {public $a = 1, $b = 2;} $o = new o; foreach (get_object_vars($o) as $k => $v) { print $k . '->' . $v . PHP_EOL; } Output: a->1 b->2 Existing public variables can be…
Code4R7
  • 2,600
  • 1
  • 19
  • 42
2
votes
1 answer

Restriction on object property ontology in Protege

I have created an ontology in Protege 5.2 and now I am trying to create correctly the object properties of my corresponding classes. Here is a snippet of my UML diagram according to which I have built my ontology: Snippet of my ontology Regarding…
2
votes
1 answer

Object property not updating

My MVC5 project View makes an api call to api/movies where the following logic exists: (First, this is how the moviesDto is instantiated): var moviesQuery = _context.Movies.Include(m => m.Genre); var moviesDto = moviesQuery.ToList() …
PakiPat
  • 1,020
  • 14
  • 27
2
votes
1 answer

How to access the current element property name of the called function

For logging purpose, I've created a wrapper function for an element functions properties. The wrapper function is above: functionsWrapper: function () { for (i = 0, args = new Array(arguments.length); i < arguments.length; i++) { args[i]…
ad-venture
  • 23
  • 3