Test case details

Preparation Code

Test cases

Test #1

function mulNumber(n) { return n * 100; } const val = 100; mulNumber(val);

Test #2

function mulNumber(n) { return n * 100; } const val = 100; mulNumber(val); // as Money

Test #3

const moneyIdentity = Symbol(); function makeMoney(from) { return { value: from, [moneyIdentity]: true }; } function mulNumber(n) { return { ...n, value: n.value * 100 }; } const x = 100; mulNumber(makeMoney(x));

Test #4

const moneyIdentity = Symbol(); function makeMoney(from) { return { value: from, [moneyIdentity]: true }; } function mulNumber(n) { return { value: n.value * 100, [moneyIdentity]: true }; } const x = 100; mulNumber(makeMoney(x));