Forum Discussion
Philip_Baird
11 years agoCommunity Expert
Hi Ocean, no, you can not do what you want. However, you can use the logical or operator as a type of null coalescing operator to assign a default value to a local var as such:
function CustomMethod(param1, param2)
{
var a = param1 || 'root';
var b = param2 || 100;
}
Regards,
Phil Baird
function CustomMethod(param1, param2)
{
var a = param1 || 'root';
var b = param2 || 100;
}
Regards,
Phil Baird
Related Content
- 2 years ago
Recent Discussions
- 4 days ago
- 4 days ago