Fix code smell in JS

As reported by PHPStorms static code analysis.

Change-Id: I540de0e1042158f4bf9f64da30497b7bc79b00b6
Merge "Fix code smell in JS"