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(tmp:any):string; 17var num1:number = 123; 18var num2:number = 0; 19var num3:number = -0; 20var num4:number = 123.456; 21var num5:number = NaN; 22var str:string = "abc"; 23var empString:string = ""; 24var undefinedValue:undefined = undefined; 25var nullValue:null = null; 26var arr : Array<any> = [1, "a"]; 27var obj : {[key:string]:any} = {name: "a"}; 28 29print(true || true); 30print(true || false); 31print(false || true); 32print(false || false); 33print(num1 || 1); 34print(num2 || 1); 35print(num3 || 1); 36print(num4 || 1); 37print(num5 || 1); 38print(str || 1); 39print(empString || 1); 40print(undefinedValue || 1); 41print(nullValue || 1); 42print(arr || 1); 43print(obj || 1); 44