Skip to main content
How are we doing? Please help us improve Stack Overflow. Take our short survey

All Questions

-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
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 votes
1 answer
74 views

Adding values to object inside array not working - cannot set property of undefined

I am trying to transform a JSON that was build from a CSV file [ { "id_familia": 15, "relacao": 1, "occupation": "RESPONSAVEL", &...
user3299563's user avatar
-1 votes
1 answer
69 views

Typescript - Object display correct datas but properties are undefined on access

When I log the entire object all the datas are displayed but when I try to access the properties they are undefined. As if the object's properties where not mapped to their datas. A component ...
Pouillaude Alexis's user avatar
0 votes
0 answers
15 views

Learning to use functions in objects... I can't understand why my function is outputting undefined [duplicate]

So I am creating a simple object with one of the properties being a function... I cannot figure out why when I call it, it outputs undefined! Here is the code... const team = { partner1: "...
DaShaman's user avatar
  • 157
1 vote
2 answers
112 views

TypeError: Cannot read property 'MyProperty' of undefined

I have an array of object pairs like so: 0: pairs {_stim1: {img: "images/F111C.png", gender: 0, rating: "3"}, _stim2: {img: "images/F042C.png", gender: 0, rating: "3&...
Jonas Bohlin Tvedt's user avatar
0 votes
1 answer
125 views

Property is undefined while trying to access property of javascript object

I am getting overwhelmed with this issue, can't figure it out. I am parsing a sample csv with 5 lines (using csv-parser nodejs module), all the first properties of all 4 objects are undefined. I ...
TiagoM's user avatar
  • 3,506
0 votes
1 answer
60 views

object property coming up as undefined

Through recursion i'm adding data to the obj['prop'] property in forms of db query results. let obj = {}; if (obj['prop'] == undefined) { obj['prop'] = {}; } console.log(obj); Why ...
Rahh's user avatar
  • 109
0 votes
3 answers
2k views

Let undefined property be null value in Laravel

Is there any way to make object undefined property become null value? Because laravel request object will auto make undefined property become null value like below. $request->test; // This ...
Simon Ng's user avatar
1 vote
1 answer
95 views

Console Log behaviour - Cannot read Object property

I'm building an angular web app. In the ngOnInit of the component: public ngOnInit() { this.log.debug("INSTANCE", this.Instance); this.log.debug("ACTIVITY",this.Instance.entity); this....
overcomer's user avatar
  • 2,324
2 votes
2 answers
519 views

Javascript object props [duplicate]

The syntax in JavaScript for accessing the property of an object is: object.property or object["property"] or object[property] I was trying out this lesson on freeCodeCamp: var myObj = { gift: "...
andres's user avatar
  • 311
0 votes
1 answer
1k views

IntersectionObserver: "Uncaught TypeError: Cannot read property of undefined" when called onIntersection()

I have following code: var ObjectOne = { a : { b : 4, ... } observer : 0, ... init() { this.a.b = 5; ... this.observer ...
Alex Shul's user avatar
  • 500
0 votes
2 answers
192 views

Comparison with undefined or "undefined" when checking for object property. What is the difference?

I encountered this difference between undefined and "undefined" and I am trying to understand it. I was checking whether properties in objects are defined or not. In first example I checked ...
Lovro's user avatar
  • 185
5 votes
3 answers
13k views

javascript: best way of checking if object has a certain element or property?

Suppose I have this: var person = { "name": "John Doe", "email": "[email protected]" }; This object only has two elements called name and email. Some persons also have an element age, but this ...
RocketNuts's user avatar
  • 10.7k
0 votes
3 answers
409 views

Cannot set a property dynamically in an object

My goal is to set properties like name, hidden and no_parent dynamically but it keeps giving me: TypeError: Cannot set property 'name' of undefined Even if I initialized scorcroot before passing ...
ImFireblade's user avatar

15 30 50 per page