Skip to content

get returns reference to inner array #9

@mrstux

Description

@mrstux

This is perhaps expected, but is it correct?

	it( 'results of prevous get should not be modified by future set', () => {
		let map = new Multimap( [['a',1]]);
		
		let aList = map.get('a');
		assert.strictEqual(aList.length, 1);
		
		map.set('a', 2);
		
		// aList.length is now 2
		assert.strictEqual(aList.length, 1);
	});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions