zoukankan      html  css  js  c++  java
  • 主题:javascript with用法

    with (object)
       statements
    参数
    object
    新的默认对象。
    statements
    一个或多个语句,object 是该语句的默认对象。
    说明
    with 语句通常用来缩短特定情形下必须写的代码量。在下面的例子中,请注意 Math 的重复使用:

    x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
    y = Math.tan(14 * Math.E)
    当使用 with 语句时,代码变得更短且更易读:

    with (Math){
       x = cos(3 * PI) + sin (LN10) 
       y = tan(14 * E)
    }

    原创内容请您保留出处及地址 , 主页:展益
  • 相关阅读:
    基本命令
    Unicode Locale
    二进制查看编辑
    java reg
    java util
    js util
    跑到X
    [转]Linux AIO :libaio
    [转]c++ atomic操作
    [转] dpdk笔记
  • 原文地址:https://www.cnblogs.com/newmin/p/2240935.html
Copyright © 2011-2022 走看看