6 ms·
Wait: nip 'function(l) { return /^var/.test(l); }' is supposed to be better than egrep '^var' ?
by ajays 11y ago
Wait:
nip 'function(l) { return /^var/.test(l); }'
is supposed to be better than
egrep '^var'
?
- fineline 11y agoI think he was demonstrating function syntax. This shorter version also works: nip 'return /^var/.test(line)' An implicit return, added if the input doesn't match /[function|return]/ would be nice, along with aliasing line as l, then you'd have: nip '/^var/.test(l)'