Question from the Angular 4 (legacy) test

AngularJS: How to fix the error 'Cannot assign to 'bar' because it is a constant or a read-only property.'

Hard

Given the following code:

type Foo = {
    readonly bar: number;
    bas: number;
}

let foo: Foo = { bar: 123, bas: 456 };

foo.bar = 18;
foo.bas = 10;

What will this code produce?

Author: Mathieu RobinStatus: PublishedQuestion passed 479 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!