You need to sign in to do that
Don't have an account?
Annu Singh 16
How to bind properties in Object in LWC
Hi All
I want to console log an object which I creating in javascript. but while running it is showing Undefined in Rsult.
here is the code
@api Value='hello';
let mutiQuery={warn:this.value};
handleClick(){
console.log(JSON.stringify(this.multiQuery));
}
if I write mutiQuery={warn:'hello'};
then its working fine but on writing this.value it is showing undefined
how can I solve this.
I want to console log an object which I creating in javascript. but while running it is showing Undefined in Rsult.
here is the code
@api Value='hello';
let mutiQuery={warn:this.value};
handleClick(){
console.log(JSON.stringify(this.multiQuery));
}
if I write mutiQuery={warn:'hello'};
then its working fine but on writing this.value it is showing undefined
how can I solve this.
Please use
you are using this.value that's you are facinfg this issue
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh