Create trick.js

commonly used js utility methods