JavaScript functional block