example in javascript
convert parameters to object
improvements