سؤال

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 ?

هل كانت مفيدة؟

المحلول

Use this, it should work.

saveTeacher: function(e) {
  this.md5(str);
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top