JavaScript Code: