Bring the JS function definition out into a separate variable too.