title: How to check if data attribute exist with plain javascript?
body: <p>I want to check if an HTML5 data attribute exists using plain javascript.
  I have tried the below code snippet, but it doesn't work.</p>
  
  <pre><code>if(object.getAttribute("data-params")==="undefined") {
     //data-attribute doesn't exist
  }
  </code></pre>