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
Nandhini S 3Nandhini S 3 

error on console.log

I'm getting error when i use console.log statement.
User-added image
SwethaSwetha (Salesforce Developers) 
HI Nandhini,
What is the error message you are seeing? Thanks
Nandhini S 3Nandhini S 3
Hi Swetha,

It just says unexpected token.
SwethaSwetha (Salesforce Developers) 
To understand the cause of why accList is being considered as unexpected token, can you share your code snippet.
Nandhini S 3Nandhini S 3
I'm getting that error even if i don't give any value in the braces.
 
SwethaSwetha (Salesforce Developers) 
I see that you are using "eslint-disable-line no-console" You need to remove this to have the console debug mode enabled.

Please see https://flaviocopes.com/how-to-disable-eslint-rule/ which says,

"Consider the case where your tooling set the no-debugger and no-console rules.
There might be a valid reason for production code, but in development mode, having the ability to access the browser debugger and the Console API is essential.
You can disable one or more specific ESLint rules for a whole file by adding on a few lines:
console.log('test') // eslint-disable-line no-console

Related: https://eslint.org/docs/rules/no-console.html

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you