cookie clicker but bigger
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
453 B

  1. function replaceChildren(element, newChildren) {
  2. removeChildren(element);
  3. addChildren(element, newChildren);
  4. }
  5. function addChildren(element, children) {
  6. for (let child of children) {
  7. element.appendChild(child);
  8. }
  9. }
  10. function removeChildren(element) {
  11. while (element.lastChild) {
  12. element.removeChild(element.lastChild);
  13. }
  14. }
  15. function round(val, places = 0) {
  16. return Math.round(val * Math.pow(10, places)) / Math.pow(10, places);
  17. }