MCPcopy
hub / github.com/braziljs/eloquente-javascript / findExercise

Function findExercise

src/client/code.mjs:236–242  ·  view source on GitHub ↗
(id, chapter)

Source from the content-addressed store, hash-verified

234}
235
236function findExercise(id, chapter) {
237 let parts = id.split(".")
238 if (!chapter) chapter = getChapter(parts[0])
239 for (let i = 0; i < chapter.exercises.length; i++)
240 if (chapter.exercises[i].number == parts[1])
241 return chapter.exercises[i]
242}
243
244if (window.page && window.page.type == "code")
245 window.codeSandbox = new CodeSandbox

Callers 2

selectContextMethod · 0.85
parseFragmentMethod · 0.85

Calls 2

getChapterFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected