function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lwc SeekarLwc Seekar 

wat does this mean in JS - lwc

code snippet: 
 handleSearchKeyChange(event){
        console.log(event.target.value)
        console.log('value==='+event.target.value)
        this.filters = {...this.filters, "searchKey":event.target.value}
        console.log('this.filters=below==='+json.stringify(this.filters))
    }

i want to know what comes output in higlighted one and how to debug it. i know its a split operator. can you explain a little detail.

if i dont keep json.stringify(this.filters) - i get output in console.log as [object ,object]

if i keep json.stringify(this.filters) - i get my component error. 
Arun Kumar 1141Arun Kumar 1141

Hi Lwc Seekar,

if you are using JSON.stringify which converts a JavaScript value to a JSON string, Javascript is a case-sensitive language and it will show an error if you use json in small.

I tried this code in my org and it works fine, have a look

handleKeyUp(evt) {
        this.filters = {...this.filters, "searchKey":evt.target.value};
        console.log('this.filters=below==='+JSON.stringify(this.filters));
        console.log('OUTPUT2 : ',this.filters);
    }

 

If you found this helpful. mark it as the best answer.

Thank You