JavaScript examples and helper methods