Lines Matching full:with
4 * you may not use this file except in compliance with the License.
18 * @tc.desc:test Array.with
25 const arr1 = arr0.with(0, 0);
32 const arr3 = arr2.with(0, 0);
38 var result1 = arr4.with(4, 100);
40 var result2 = arr5.with(4, 100);
44 // testCase1: use only one parameter in Array.prototype.with()
47 const caseOneArr2 = caseOneArr1.with(2);
52 const caseTwoArray2 = caseTwoArray1.with(2, "three");
57 const caseThreeArray2 = caseThreeArray1.with(0, 1);
58 const caseThreeArray3 = caseThreeArray1.with(1, "two");
64 const caseFourArray2 = caseFourArray1.with(0, false);
65 const caseFourArray3 = caseFourArray1.with(1, { key: "value" });
66 const caseFourArray4 = caseFourArray1.with(2, () => "world");
71 // testCase5: deal with sparse array
73 const caseFiveArray2 = caseFiveArray1.with(1, "two");
76 // testCase6: deal with indices that are negative or out of bounds
78 const caseSixArray2 = caseSixArray1.with(-1, 2);
81 print(caseSixArray1.with(-6, 2));