Sorry, this might be easy, but it puzzled me. I am trying to iterate over this array and exit each value, but the script produces a string object.
propertiesToSanitize = ["title", "description", "place_name"]
$.each propertiesToSanitize, ->
console.log this
which translates to jQuery as
var propertiesToSanitize;
propertiesToSanitize = ["title", "description", "place_name"];
$.each(propertiesToSanitize, function() {
return console.log(this);
});
returns:
String
0: "t"
1: "i"
2: "t"
3: "l"
4: "e"
length: 5
Any idea why she returns this instead of "title" or any other value? Thanks in advance for any help.
source
share