Smart arguments management for javascript