js named functions

@jlongster r?