Because of jslint error : Function declarations should not be placed in blocks.