Steps to find the JavaScript average