We can do this using Object.groupBy() method. This method groups elements of an object according to values returned from a callback function. Example: const users…
We can save data in Local Storage with the help of setItem() method of localStorage object. Example: localStorage.setItem( "userInfo", { "name": "John", "gender": "male", "age":…