Reputation: 509
I have a function, which I would I like to call and pass a variable from another function. The function being called then returns a variable. I am unsure as to how to complete this task. I have attempted a varying number of ways but none with any success. Here is the sample code:
md5: function ( str ) {
return String
}
I want to call this md5 function from inside this function:
saveTeacher: function(e) {
}
How would I achieve this ?
Upvotes: 0
Views: 76
Reputation: 2257
Use this
, it should work.
saveTeacher: function(e) {
this.md5(str);
}
Upvotes: 8