function for a value to go up +0.01 when called in javascript not working (beginner)

function startGame(){
  let currentpoints = 0.01;
  var writepoints = document.
  getElementById("score").innerHTML = currentpoints += 0.01;

This function is called by a button that you press, and its purpose is simple, it
displays currentpoints to an html element by ID after increasing its value.
The code will run with no errors and go up from 0.01 – to 0.02, but it stops there.
it remains 0.02 and does not proceed to go up.

My theory is when the function is called, the declaration of currentpoints is set again to its 0.01 value , but I don’t want that, I want it to proceed to go up every time you press the button (call the function), so can someone tell me my remedy to this solution?

Thank you guys, I am a beginner trying to get involved in a way that is fun and rememberable for me. (simple mini game)
New here by the way to stackoverflow.

16 thoughts on “function for a value to go up +0.01 when called in javascript not working (beginner)”

  1. 423210 85025Quite very best people messages are meant to charm allow honor toward groom and bride. Newbie speakers in front of excessive locations ought to usually our own gold colored dominate in presenting and public speaking, which is to be private interests home. greatest man speach 344186

  2. 393535 962520In the event you have been injured as a result of a defective IVC Filter, you ought to contact an experienced attorney practicing in medical malpractice cases, specifically someone with experience in these lawsuits. 828154

  3. 413233 149664My California Weight Loss diet invariably is an cost effective and versatile staying on your diet tv show created for folks who discover themselves planning to drop extra pounds and furthermore ultimately maintain a a lot healthier habits. la weight loss 163291


Leave a Comment