MCPcopy Create free account
hub / github.com/braziljs/eloquente-javascript / skipSpace

Function skipSpace

code/solutions/12_3_comments.js:1–4  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

1function skipSpace(string) {
2 let skippable = string.match(/^(\s|#.*)*/);
3 return string.slice(skippable[0].length);
4}
5
6console.log(parse("# hello\nx"));
7// → {type: "word", name: "x"}

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected