JavaScript code for PE problem 380 added.