Closed sanriqing closed 5 years ago
Hi @sanriqing thanks for being curious! So your code at the bottom does not work in the same way as the function; for example here is an example of a different result:
> parseTokenList('fo o,bar')
[ 'fo o', 'bar' ]
> 'fo o,bar'.replace(/\s/g,'').split(',')
[ 'foo', 'bar' ]
Notice that your .replace
is removing whitespace characters that occur anywhere, even in the middle of a value.
hi,Why do you write this function like this? What's the difference between ascill and normal characters?
emmmm,