added polyfill
added js example