Physics and Artificial Intelligence with JavaScript