1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16declare function print(str:any):string; 17 18print("test callthis1") 19print(Math.sqrt(9)) 20print(Math.sin(9)) 21print(Math.cos(9)) 22print(Math.acos(9)) 23print(Math.atan(9)) 24print(Math.abs(-9)) 25print(Math.floor(9.1)) 26print(Math.ceil(9.1)) 27 28print("test call1") 29let func = Math.sqrt 30print(func(9)) 31func = Math.sin 32print(func(9)) 33func = Math.cos 34print(func(9)) 35func = Math.acos 36print(func(9)) 37func = Math.atan 38print(func(9)) 39func = Math.abs 40print(func(-9)) 41func = Math.floor 42print(func(9.1)) 43func = Math.ceil 44print(func(9.1)) 45 46print("test localeCompare") 47let str1 = "Straße" 48let str2 = "Strasse" 49print(str1.localeCompare(str2, "de", { sensitivity: "base" })) 50 51let a = new Array(20) 52for (let i = 0; i < 20; i++) { 53 a[i] = Math.random() 54} 55a.sort() 56 57let b = new Array(1, 2, 5.2, 5,1, 3, 4, 5, 6, 9, 3.1, 3.2, 4) 58b.sort() 59print(b)