MCPcopy Create free account
hub / github.com/marijnh/Eloquent-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

no outgoing calls

Tested by

no test coverage detected