zoukankan      html  css  js  c++  java
  • TypeScript笔记一

    /**
     * Created by ufo9631 on 2017/5/16.
     */
    /*参数新特性*/
    var maname = "zhang san"; //声明字符串类型变量
    var alias = "xixi"; //任意类型
    var age = 12; //整形
    var man = false; //布尔类型
    function test() {
    }
    function testStr() {
        return ""; //必须要有默认值
    }
    function testStr1(name) {
        return ""; //必须要有默认值
    }
    function testStr2(name) {
        console.log(name);
    }
    var Person = (function () {
        function Person() {
        }
        return Person;
    }());
    var zhangsan = new Person(); //使用自定义类型
    zhangsan.age = 18;
    zhangsan.name = "张三";
    /*给方法指定默认值*/
    function test2(a, b, c) {
        if (c === void 0) { c = "jojo"; }
        console.log(a);
        console.log(b);
        console.log(c);
    }
    test2("hah", "heh");
    /*可选参数 b?:string  可以不传 ,必须写在必选参数后面*/
    function test3(a, b, c) {
        if (c === void 0) { c = "jojo"; }
        console.log(a);
        console.log(b);
        console.log(c);
    }
    test3("sdf");
    testStr2(123);
    //# sourceMappingURL=ts2.js.map
    

      

  • 相关阅读:
    text/css什麼意思
    w3cschool的在線編輯器的特點
    html
    notepad编写html
    html学习心得
    html 链接
    資料鏈接
    微信小程序的界面下拉刷新
    C# PictureBox控件畫圖
    CPK公式
  • 原文地址:https://www.cnblogs.com/sumg/p/7841415.html
Copyright © 2011-2022 走看看