Search code examples
javascriptintellij-ideaintellij-14

How to prevent certain warning on IntelliJ?


What's the correct way to prevent warnings on IntelliJ, for example this code:

warning

the .children_str gives warning Unresolved variable children_str. The children_str property is a string, and row is an Object.

Normally I would add a namespace (I don't know what is it, but it removes those warnings):

after adding namespace

But then another warning appeared Unresolved function or method split()

What's the correct way to tell IntelliJ that children_str is a string to remove those warning message?


Solution

  • The warning can be removed by assigning and adding || operator, for example:

    row.children_str = row.children_str || '';