bite

we're going to be doing a lot of biting. it's when you bite off something at the start of some text.

this language bites off "pasta" from the start of the text, and emits it as the result.

TRANSLATED:



it's easy to bite a string.

function bitePasta(text) {
	if (text.startsWith("pasta")) {
		return "pasta"
	}
	
	throw new Error(`UNFORGIVABLE error: expected 'pasta' but found '${text.slice(0, 5)}'!`)
}

back to the dream