iterables-containing-string-objects.js (698B)
1 // Copyright (C) 2025 Kevin Gibbons. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-iterator.zipKeyed 6 description: > 7 Accepts String objects as inputs. 8 includes: [compareArray.js] 9 features: [joint-iteration] 10 ---*/ 11 12 var result = Array.from(Iterator.zipKeyed({ 13 a: Object("abc"), 14 b: Object("123"), 15 })); 16 17 assert.sameValue(result.length, 3); 18 result.forEach(function (object) { 19 assert.compareArray(Object.keys(object), ["a", "b"]); 20 }); 21 assert.compareArray(Object.values(result[0]), ["a", "1"]); 22 assert.compareArray(Object.values(result[1]), ["b", "2"]); 23 assert.compareArray(Object.values(result[2]), ["c", "3"]); 24 25 reportCompare(0, 0);