I am quite newish at nodejs and javascript in general, and I have been trying to figure out how to make a function that executes on a variable, e.g.
var string = "Hello there";
var string1 = "Hello there again"
string = string.function();
string1 = string.function();
I am aware that this can be achieved by doing something like this function(string);
, but I am a massive fan of more "inline code" and would like a nicer way to do it.