How to pass a value from javascript to drupal 8 form?

I need to pass a value from Javascript to my drupal 8 form. I’ve added a hidden field to the form. Javascript is calculating a value and writes it into the field. But how can I get to the value …

is there a way to exchange variables between JavaScript and PHP

I have build a website in Drupal, and I am trying to create a fun way to get members involved with the site by building a userpoint system, the system is all in place, but I’m trying to make a shop …