函数 clone #

克隆一个对象。将对数据进行深度复制。

Syntax #

math.clone(x)

Parameters #

Parameter Type Description
x * 要克隆的对象

Returns #

Type Description
* 对象 x 的克隆

Throws #

Type | Description —- | ———–

Examples #

math.clone(3.5)                   // returns number 3.5
math.clone(math.complex('2-4i'))  // returns Complex 2 - 4i
math.clone(math.unit(45, 'deg'))  // returns Unit 45 deg
math.clone([[1, 2], [3, 4]])      // returns Array [[1, 2], [3, 4]]
math.clone("hello world")         // returns string "hello world"
Fork me on GitHub