* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function helper1(x) {
return x * 2;
}
function helper2(a, b) {
return a + b;
}
function factorial(n) {
if (n <= 1) {
return 1;
}
return n * factorial(n - 1);
}
function function_call_test()
{
let result = 0;
result = helper1(5);
result = helper2(result, 10);
result = factorial(5);
let obj = {
value: 10,
getValue: function() {
return this.value;
},
add: function(x) {
return this.value + x;
}
};
result = obj.getValue();
result = obj.add(5);
let str = "Hello";
result = str.length;
let arr = [1, 2, 3];
result = arr.push(4);
result = helper1(helper2(3, 4));
return result;
}
ArkTools.arkSteedCompileSync(function_call_test);
let output = function_call_test();
print(output);