Executing Javascript in Chrome Browser doesn't do anything

Most likely because you have not enabled JavaScript from Apple Events.
See Announcement: Google Chrome 68 Disables KM Access -- How To Fix

Your JavaScript runs fine for me in Google Chrome 70.0.3538.110 (3538.110) on macOS 10.12.6.