I'm trying to create a custom string method.
I'm not sure how to get the value of the string, that the method is attached to, passed to the function and back.
function testPrototyping(passedVar) {
passedVar += " reason why this is not working";
return passedVar;
}
String.prototype.testMethod = testPrototyping;
var myVar = "some";
var myVar2;
// 1. This works but is not what I want:
myVar2 = myVar.testMethod(myVar);
// 2. This is what I want but doesn't work:
myVar2 = myVar.testMethod();
// 3. Wondering if this should work also:
myVar2 = testMethod(myVar);