Update 4.js

added brackets around the if block