Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let x = { foo: { bar: "baz" } };
- console.log(x.foo!.bar);
- const x: string = "foo";
- const y = x!.indexOf("f"); // <-- x is of type string; no need to assert non-null
- This assertion is unnecessary since it does not change the type of the expression.
Add Comment
Please, Sign In to add comment