Trying to combine all value from jquery.each function
<p>Look at my code, I am trying to combine all value from the <code>jquery.each</code> to a string like this ok,good, and then passed to ajax value. Appreciate. or <code>array('ok','good')</code> acceptable also</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var global = {
    "44":["onset","frequency"],
    "45":["onset"]
};
var $val = global[44];
            
jQuery.each( $val, function( key ,value) {  
    var value = $('#'+value).val();   
});
var $combine = ;//not sure how to combine all value like this (ok,good), or array(ok,good) acceptable also
var data= {
    action: 'check_first',
    AjaxFrontNonce : ajax_csky.AjaxFrontNonce,
    combine : $combine
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="hidden" id="onset" value="ok"&gt;
&lt;input type="hidden" id="frequency" value="good"&gt;</code></pre>
</div>
</div>
</p>