title: How to use jQuery function stored as a value in an object?
body: <p>I am a little over my head with understanding why this is not working and how to fix it.</p>
  
  <p>I have an object created using wp_localize_script() in another file and I'm using it to pass a value to my js file. </p>
  
  <p>I am passing other more static values this same way and it is working well, but I have one instance where the value I am passing is a jQuery function that I need to be executed.</p>
  
  <pre><code>jQuery(document).ready( function ($) {
  
      if( wptjCustomInit.opt != "" ) {
  
          wptjCustomInit.opt;
  
          console.log(wptjCustomInit.opt); //outputs correct content: $('.table-juice').DataTable();
  
      }else{
  
      ...other code...
  </code></pre>
  
  <p>My goal is for the content of the object to be processed along with the rest of the script as if it had been in the file all along. </p>
  
  <p>I'm guessing I just don't understand something fundamental and I'm not getting to the right scenario in my search attempts. I'm grateful for any help! (sorry for my ignorance)</p>