Update problem2.js

-- Change "array" to "arr" as var name.