JavaScript examples and testing