I was going to post this as a comment to palacsint's answer palacsint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
One way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});
I was going to post this as a comment to palacsint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
One way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});
I was going to post this as a comment to palacsint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
One way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});
I was going to post this as a comment to palascint'spalacsint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
oneOne way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});
I was going to post this as a comment to palascint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
one way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});
I was going to post this as a comment to palacsint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
One way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});
I was going to post this as a comment to palascint's answer but it helps to have code blocks.
Because you're using this pattern in several places:
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
...
}
}
one way you can reduce the depth of the "arrowing" is to extract that out into its own function:
function iterateMap(obj, fn, scope) {
for(prop in obj) {
if(obj.hasOwnProperty(prop)) {
fn.call(scope || this, prop);
}
}
}
...
iterateMap(obj, function(prop) {
...
});