If compared values are true then $.getJSON()
问题 This is a follow up to my earlier question. I wanted to compare the results I get back from filling out a form. This is what I have so far: const eqObj = (obj, source) => Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]); $('#btn').on('click', function() { let $inputs = $('#new_form :input'); let new_vals = {}; $inputs.each(function() { new_form[this.id] = $(this).val(); }); console.log(new_vals); $.getJSON(api, function(data) { data.forEach(d => { console