Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Recent content by giomach

  1. G

    JavaScript How to use a list?

    I appreciate your input, EkBass. I'm pleased that I wasn't too far off the mark in my inexperienced use of variable-length arrays, and that it was just a careless syntax error after all. It now runs fine in the trial version of HMTLPad2018.
  2. G

    JavaScript How to use a list?

    I think I've got this now. Pair of extra brackets needed around "contains (numArray, temp)". It still doesn't work in the development environment I was using (HTMLPad 2010 — old!), but it works when run from a browser. So I need to upgrade.
  3. G

    JavaScript How to use a list?

    Thanks, EkBass, but on re-checking W3Schools (arrays, functions) I still don't see what is wrong with my function. Just de-commenting "const numArray = [];" is enough to make the webpage fail, even if the function is never called. I should have included the two other small functions called...
  4. G

    JavaScript How to use a list?

    function select (n, min, max) { /* Return n unique numbers selected randomly from the contiguous range min..max inclusive (n <= max-min+1) */ /* const numArray = []; */ var temp; for (var i = 1; i <= n; i++) { temp = getRndInteger (min, max); /* if contains (numArray, temp)...
Back
Top Bottom