Create logic.js
Merge pull request #1 from ix/master

add javascript logic