JSFiddle - React, Tailwind, and code Playground

by de Montalembert Jonathan

JavaScript

const g = [1,9,2,3,4,6,7,5,10]
let expected = 0;
let actual = 0;
g.forEach((i, id) => {
actual += i
expected += id + 1
})
expected += g.length + 1 // the extra iteration that should have happened
console.log("missing number", expected - actual)