Method in JavaScript, test with argument