Object method not working
Hi, so if you see my image, for some my method is not working, I have already looked online (Checked few websites, w3schools had an example, this is exactly that, but instead of const object{...} I did Function Object(args){methods and properties})
If I just look for the property using console.log(admin.getAccesKey) it claims it is undefined.... Could someone please point out to me what I did wrong? I feel like it'd probably be something stupidly small but I just can't seem to figure it out
This is all there is to the code btw, I am simply testing it out first before going on to the next step...But on step 1 its already going wrong xd
3 Replies
So yeah, I can get everything but the method
What is making my method nonexistent to my object?
Okay, I am mad...
So I added "this." before my method and it is working now, for crying out loud...
but I thought you didn't have to add "this." for the methods ?
with object constructors you do need the this. for methods
with classes you don't have to