cookie clicker but bigger
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

21 wiersze
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. }