array length with key-value, js
问题 I wrote this piece of code, that should parse the given paramUnparsed (which should be an array in the form: [key1=val1, key2=val2, .., keyn=valn] ). function parseParams(paramUnparsed){ var params = []; for ( var j = 0; j < paramUnparsed.length; j++) { if (paramUnparsed[j].split('=').length < 2) { // error ! bad input structure, ignoring params - params = undefined; break; // we don't have to return error, depending // on the function called and given params. } //else { var key =