Any idea why my JS function isn't working?

  • Thread starter Thread starter Jamin2112
  • Start date Start date
  • Tags Tags
    Function Idea
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
30 replies · 4K views
I second harborsparrow's recommendation of "JavaScript: The Good Parts". For reference, I also have David Flanagan's "JavaScript: The Definitive Guide", 6th Ed.

Jamin2112, I don't know if you took me up on my suggestion to use the F12 debugging tools (available in pretty much any browser). Debugging your code using these capabilities would provide answers to many of the questions you've asked.

There is also the timeworn method of using print statements to display the values of variables at certain locations in your code. You can do this by adding alert(...) statements in your code.