title: How to pass js Object and functions to a web component
body: <p>Hi All I am a beginner in javaScript and currently exploring JS Web-component and I got stuck due to some use cases</p>
  
  <p>1 ) I want to pass a JS Object into my component like </p>
  
  <pre><code>&lt;my-component data=obj &gt;&lt;/my-component&gt; 
  </code></pre>
  
  <p>And require to use inside my component code Like </p>
  
  <pre><code>connectedCallback () {
      console.log(this.data) // it should print {"name":"xyz" , "role" : "dev"}
  } 
  </code></pre>
  
  <p>2 )  I also need to pass some functions or maybe call back functions like.</p>
  
  <pre><code>function myFunction(e){
     console.log(e)
  }
  
  &lt;my-component click=myFunction &gt;&lt;/my-component&gt;
  </code></pre>
  
  <p>please try to add code snippet also in ans that will help me to learn more JS.
  Thanks</p>