Or with optional chaining even better to
window?.navigator?.vibrate?.([200,100,200]);
Beware that this is still in experimental support! So if the browser does not support this syntax this will throw an error.
But I would of course use this syntax if I was using a transpirer for instance. Really shorten the syntax and looks nice!
Sure, then again the browsers that support vibrate and actually vibrate support it so for the most part it's harmless
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Or with optional chaining even better to
Beware that this is still in experimental support! So if the browser does not support this syntax this will throw an error.
But I would of course use this syntax if I was using a transpirer for instance. Really shorten the syntax and looks nice!
Sure, then again the browsers that support vibrate and actually vibrate support it so for the most part it's harmless