3 ms·
Am I the only one who saw the string representation of the nested array and said "you could just walk it character by character and ignore the brackets and comm
by mmcconnell1618 10y ago
Am I the only one who saw the string representation of the nested array and said "you could just walk it character by character and ignore the brackets and commas?"
- franciscop 10y agoThat is indeed, depending on the context (you know the strings won't contain commas OR that it should be split in the commas), one way to do it in Javascript ( https://github.com/franciscop/umbrella/blob/master/src/plugins/args/args.js#L17 https://github.com/franciscop/umbrella/blob/master/src/plugi... ): return args.toString().split(/[\s,]+/).filter(/* ... */);
- throwaway729 10y agoRubric item #10: "No one thinks about generic program so that solution will work across all types." you fail. (I don't intend to be mean to you, I intend to be mean to the question ;-) )