Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const obj = {
- foo: 'das',
- bar: 'few',
- baz: '',
- };
- var x = ''; // I must assign the variable ''
- if (obj[x] != '') {
- //do something
- }
- Element implicitly has an 'any' type because type '{ foo: string; bar: string; baz: string; }' has no index signature.
Add Comment
Please, Sign In to add comment