Checking for duplicate strings in JavaScript array

I have JS array with strings, for example: var strArray = [ “q”, “w”, “w”, “e”, “i”, “u”, “r”]; I need to compare for duplicate strings inside array, and if duplicate string exists, there should be …

Generic deep diff between two objects

I have two objects: oldObj and newObj. The data in oldObj was used to populate a form and newObj is the result of the user changing data in this form and submitting it. Both objects are deep, ie. they …

How to know if two arrays have the same values

I have these two arrays: one is filled with information from an ajax request and another stores the buttons the user clicks on. I use this code (I filled with sample numbers): var array1 = [2, 4]; …