All Questions
Tagged with object properties
1,191
questions
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, '...
-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(...
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 ...
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". ...
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 ...
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: "...
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 ...
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 ...
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>
...
-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 ...
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 ...
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',
...
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 ...
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 ...
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....