1. // 函数传参
    2. function fun(s:string):string{
    3. console.log(s)
    4. return s
    5. }
    6. fun('hello')
    7. //默认参数
    8. function fun2(s:string="hello"):string{
    9. console.log(s)
    10. return s
    11. }
    12. fun2('good')
    13. // 任意类型 any
    14. function fun3(s:any):any{
    15. console.log(s)
    16. return s
    17. }