Javascript: First JS component ticking