Completed JavaScript