where did you failed? this simple program works well. how did you fail then? actually you didn't fail, but you are not satisfied. for me you made it well & impressive application works on javascript. congratulations @cryptoctopus
reteemed & upvoted & commented & followed@resteemia