Skip to main content

All Questions

Tagged with
0 votes
1 answer
43 views

getting error when modifying the javascript property using Object.defineProperty()

obj = [{ prop11: 'value1', prop21: 'value2' }, { prop12: 'value1', prop22: 'value2' }, { key3: {} } ]; obj.forEach(element => { Object.defineProperty(obj.key3, '...
Vijay G Rama's user avatar
-1 votes
1 answer
24 views

I am trying a display items (events) from db typescript nestjs using handlebars the events are an array of object. Properties of each object undefined

please look at the way i am passing the events check for the issue @Get('views/users/events') async findAllEvents( @Req() req: Request, @Res() res: Response, @Query('page') page: number = 1, @Query(...
Samie Ezealor's user avatar
0 votes
0 answers
16 views

powershell array of object with dynamic properties outputs only properties from first element [duplicate]

why ? and how to fix this ? how to export to csv file now after export i receive the same as when displaying $res. $res= @() $obj = [PSCustomObject]@{} $obj | Add-Member -MemberType NoteProperty -Name ...
Tomasz Szczypiński's user avatar
0 votes
2 answers
32 views

Object property has different many string values

I have objects, that has different properties, one of them is programingLanguage. So, with the function, I want to check if the object property - programmingLanguage has a value of "Java". ...
Zuka Kharati's user avatar
0 votes
1 answer
32 views

Explanation on access an object property that does not exist on an DOM element

I am a beginner on JavaScript, looking for a explanation on accessing to an object property that does not exist on an DOM element. I am working on a todo apps. Below is my current code but it is not ...
Kwok's user avatar
  • 13
0 votes
4 answers
90 views

How can I write a function that returns the objects in an array that have the two same property values?

Let's say I have the following object: const myObjects = [ { name: "Alice", age: 30 }, { name: "Bob", age: 25 }, { name: "Alice", age: 30 }, { name: "...
Ralph David Abernathy's user avatar
0 votes
0 answers
26 views

Why I need to access multiple nested properties of an object? [duplicate]

Please don't close my question. Earlier it was closed with a wrong solution, Assignment with double ampersand "&&". Please help me understand the Redux code. Why can't I use directly ...
Zonaed Hasan's user avatar
1 vote
1 answer
40 views

Triggering method with change in object property

I have an array of dataframe objects (columns of a larger dataframe) that I am passing into the Dataframe_Builder_Update class. I am able to successfully update the date and associated calculation of ...
steezebutter's user avatar
0 votes
1 answer
43 views

How to Include All Properties in GridView Even if They're Absent in Some Objects?

I'm using PowerShell to parse XML content and display the results in a grid view. Here's the code I'm using: $content = @" <root> <obj> <name>John</name> ...
Fajela Tajkiya's user avatar
-1 votes
2 answers
44 views

Adding objects as properties of a master object with Javascript

I have a master object, for example: MasterObj = { property1: ... method1: ... } and multiple other objects: obj1 = { properties and methods... }, obj2 = { properties and methods... } I need to make ...
user3952846's user avatar
0 votes
0 answers
53 views

ChromeDevTools SetVariableValue: how change object property? array cell?

How to change an object property using the ChromeDevTools? I ran the following code on nodejs with debugger support: function test() { var obj = { "my_prop": 1 } return ...
Norem's user avatar
  • 1
0 votes
1 answer
43 views

Adding values from a JavaScript object as classes on an element

In JavaScript, how would I take the values of an object and add each one as a separate class on an element in the DOM? For instance, let's say I have this object: const METADATA = { foo: 'test1', ...
user avatar
1 vote
2 answers
89 views

Is there a Javascript/Lodash function to check if an object is missing ANY properties?

I want to check a javascript object to see if any of it's properties are missing without checking each property individually. I can use "hasownproperty" or do if/else statements to check if ...
Laura Drill's user avatar
0 votes
1 answer
369 views

How to make a method, that accepts an input, into a property of a class object?

The issue I've encountered here, is that I am currently trying to make an object that has a method as a property. I was able to get it to work on public static void methods, but not methods that ...
kenLeeDep's user avatar
0 votes
1 answer
183 views

Adding a property that is hidden unless it has a value

I'm adding a class related to software packages. Here is a barebones version for the purposes of this question: class Package { $Name; $Latest; $Prerelease [string]ToString(){ return $this....
Maybe's user avatar
  • 843
1 vote
1 answer
235 views

How can I read the name of a thread in a C# application?

I'm working on a multithreaded application, written in C#. I would like to verify if a thread is already running or not. You might think "How easy can that be?", but there seems to be a ...
Dominique's user avatar
  • 17.1k
0 votes
1 answer
20 views

I've been trying this code for a for loop inplementing an array into it

const jonas = { firstName: 'Jonas', lastName: 'Billing', age: 2037-1991, job: 'teacher', friends: ['Michael', 'Peter', 'Steven'] }; const types = []; for (let i = 0; i < jonas.length; i++) { ...
Damilola's user avatar
0 votes
0 answers
25 views

How can I access an object property inside the object while inside a function in the property without a getter?(javascript)

I have this code where I want all my code to be inside one main object without exeptions: var inputs = []; var Ivh = { addInput: (input, display, message, regex) => { inputs.push([input, ...
Koby K's user avatar
  • 41
2 votes
3 answers
59 views

Neater way to create an object

I am creating an object with values from an api response. Is there a neater way to do this? My code: const variables = { name: result.data.data.table.name, org: the_org, val1: result.data....
nb_nb_nb's user avatar
  • 1,347
0 votes
2 answers
2k views

TypeError: object of type 'property' has no len()

I have this code of a class that contains a list _offers of custom Offer objects. For this list I created a property to allow access to it: class OffersManager: _offers: list[Offer] = [] ...
Itay Dvash's user avatar
0 votes
0 answers
33 views

Why can't I access a property of an object in a loaded array of objects in typescript?

So, I cannot wrap my mind around this problem... Basically, I have some variables and a constructor in a class: currentUser: UserModel | null = null; currentServer: ServerModel | null = null; ...
btror's user avatar
  • 125
1 vote
0 answers
15 views

Typescript: map nested object properties to string [duplicate]

I am wondering if it is possible to create a type which maps properties of an object to a string where if a certain property value is an object himself, it is added to the string preceded by a dot. ...
asnaeb's user avatar
  • 725
0 votes
0 answers
67 views

Creating Events in Powershell

The Task: I'm writing a script that makes changes to an AD Object (user account) in sequential order: Name change Group add Demographics change Manager name added Add email address The problem: I ...
Liquyd's user avatar
  • 1
2 votes
1 answer
708 views

typescript access object property: Element implicitly has an 'any' type

I'm working on a codebase where I need to access a value from the step property. interface Car { name: string; age: number; color: string; step: { something: { onea:...
json's user avatar
  • 21
-3 votes
2 answers
167 views

System.NullReferenceException Object reference not set to an instance of an object (List) [duplicate]

public List<Faculty> Faculties {get;set;} List<Faculty> faculties = FacultiesManager.Faculties; Faculties.Add(something); how can i interact with the object list
nomnom's user avatar
  • 17
2 votes
2 answers
925 views

A way to catch any change of an object with properties

I have a simple program that's supposed to capture any change of object A. When it does detect a change, it will write down the stringified object into file A. Now the most obvious approach would be ...
Mathue24's user avatar
  • 152
0 votes
2 answers
96 views

I want to filter an array of objects through an object property

I´m new to Javascript, I´m trying to filter an array of objects through one of the object properties (to get the object that has the biggest value of said property. How would I go about to doing that? ...
Zeke Cachi's user avatar
3 votes
2 answers
577 views

Is there a way of accessing the properties of an object in java by using a string to represent the property's name, just like in JavaScript?

In JavaScript you can access a property of an object in two ways: object.property object["property"] In Java, I am only aware of the first way. Is there a way to access a Java object's ...
Dark Rebellion's user avatar
0 votes
1 answer
224 views

How can I add Nested Object List Properties to an existing Object

I'm trying to figure out how I can add an object list property to an existing object, which also has a list object property. I have 3 classes as FirstList, SecondList, and ThirdList with an Id and ...
Charlie Lipperd's user avatar
0 votes
1 answer
48 views

While using the Object.defineProperties in JavaScript I am getting as ' undefined' on newly defined property .How to fix it..?

const object1 = { firstName : 'Shashidhar', lastName : 'B M ', rollNo : 5678, rank : 23456 } Object.defineProperties(object1,{ property1 : { results : 'selected' } }); ...
SBM's user avatar
  • 17

15 30 50 per page
1
2 3 4 5
40