Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 01:27 PM
I want to call a function from a function in Script
funct_name_1: function(){
// Here i want to call funct_name_2
return ;
},
funct_name_2: function(){
........
........
return ;
}
Solved! Go to Solution.
Labels:
- Labels:
-
Team Development
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 01:43 PM
this keyword is very important.
funct_name_1: function(){
// Here i want to call funct_name_2
this.funct_name_2(object);//you can even pass parameters
return ;
},
funct_name_2: function(){
........
........
return ;
}
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 01:43 PM
this keyword is very important.
funct_name_1: function(){
// Here i want to call funct_name_2
this.funct_name_2(object);//you can even pass parameters
return ;
},
funct_name_2: function(){
........
........
return ;
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 04:19 AM
Hello
We can call function in other function: Please refer given script
function1: function() {
return this.function2();
},
function2: function() {
var first_name = 'name 1';
var second_name = 'name 2';
var full_name = first_name + ' ' + second_name;
return full_name;
},
You can test this script using Background Script:
var si = new script_include_name().function1();
gs.info(si);
output: name1 name2
Thank You.!
Kartik Magadum