JavaScript sampling instrument