var k = Symbol(); var foo = { [Symbol.iterator]: "foobar", get [k]() { return k; } }; expect(foo[Symbol.iterator]).toBe("foobar") expect(foo[k]).toBe(k)