I have the following code:
function doSomething(str){
return str+="a";
}
function anotherFunction(str){
return str+="b";
}
_.mixin({
doSomething:doSomething,
anotherFunction:anotherFunction
});
I want to use multiple functions together in one line, but I can't manage to work:
var output=_("startingtext").doSomething().anotherFunction();
I managed to make it work using _.chain, but I am not sure if chain should be used because in their example they are using with objects and stuff, so I really doubt this is the way to go for string manipulation.
Sorry, I am new to underscore :(, any help is appreciated.
return _(str+"a");in the first function and equivalent in the second.