Create main.js

Complete JavaScript