Rewrite IIFE as a var function in js examples