How To Calculate Score In Javascript