JavaScript: dot vs bracket notation

During linting my code jshint gave me the “hint” that I should prefer dot notation over bracket notation.

"testcase": data.finding["testcase"], [‘testcase’] is better written in dot notation.

What is that?

  • Accessing members with “.” is called “dot notation”.
  • Accessing them with [] is called “bracket notation”.

 

Leave a Reply

Your email address will not be published. Required fields are marked *