The code should test if the args array has anything in it before trying to use it. Use the array's length attribute.
If args.length is >= 2 then the code can get args[0] and args[1]
If the length...