Open jagadeeshgade008 opened 3 years ago
You doing it wrong...
let obj = { "key": { "key1": "value" } } if (obj.key.key1) { //do something console.log('true'); }else{ console.log('false'); } /*OR*/ obj.key.key1 ? console.log('true') : console.log('false');
having same issue, @jagadeeshgade008 syntax is fine, the included version of beautifier is messing it up.
@jagadeeshgade008 update the bundled version of js-beautifer: https://github.com/HookyQR/VSCodeBeautify/issues/346
After doing this, I had to restart VS Code and reload the plugin.
let obj = { "key" : { "key1" : "value" } }
if(obj.key?.key1?){ //when i format it. It is converted to obj.key ? .key1 ? ) which is not valid. //do something }