bite sized JavaScript functions