I have an object which I am iterating through it's key and pushing all of its key in an array, I need to enclose each string with single quote, so for example if I have an object {"name": true, "Updated Date": false}
I want to create array of string as ['"name"', '"Updated Date"'], The reason behind requiring this format is to make angular orderBy filter work with multiple predicate an each predicate having space in between like Updated Date
I had tried following code
var myObj = {"name": true, "Updated Date": false}
var myPredicates = [];
for(var prop in myObj) {
myPredicates.push("'" + prop + "'");
}
console.log(myPredicates);
doing that the result will be ["'name'", "'Updated Date'"]
but what I want to achieve is ['"name"', '"Updated Date"']
here is a plunker I am trying to make predicate
from filterObject