0

So I am making a number analyzer code in JavaScript and previously i was using https://www.khanacademy.org to write the code and run it in their live editor but that doesn't allow me to run window.prompt so i shifted to some other editors but all of them are giving me an error when I try to fill something with color like this:

fill (255, 0, 0);

error: JavaScript error: Uncaught ReferenceError: fill is not defined on line 3 why is this happening and how can i fix it?

  • Are you by any chance looking for `Array.fill`? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill – Tim VN Jul 30 '20 at 05:56
  • Can you share relevant code? – Hyetigran Jul 30 '20 at 05:58
  • Probably more like https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill – you need to have a canvas rendering context – Patrick Hund Jul 30 '20 at 05:58

1 Answers1

0

fill is an helper function that is only available in your course environment. window.prompt is probably disabled to avoid pranks that show thousand of dialogs lol

Maxime Helen
  • 1,382
  • 7
  • 16