Following the HTML5 stone, JSHint web audio tutorial gives this warning ...
W056 - Bad constructor.at line 26 col 73
For the next line ...
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
The JSHint docs explain that a warning is issued whenever a new one is used with an object literal, and then say that the new one is "only useful for instantiating a constructor function and does not make sense when applied to non-functional objects or literals."
It strikes me as a reasonable use, though, it is eloquent, and it is pretty obvious what it does. So I decided to throw the ignore / * jshint -W056 * / directive, but I thought I would ask in case I missed something.
So, am I missing something?
javascript jshint
technicalbloke
source share