What is the ES5
equivalent of the below code?
Object.keys($location.search()).forEach( key => ($location.search()[key] == null || $location.search()[key] == "") && $location.search([key], null));
I tried to replace the =>
with just a simple =
, that resulted in a error however.
How do I convert the above code to the ES5
syntax.
You can either convert it into a function
yourself or use something like Babel to do it for you
Object.keys($location.search()).forEach(function (key) {
return ($location.search()[key] == null || $location.search()[key] == "") && $location.search([key], null)
});