Run ❯
Get your
own Node
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
// @ts-check /** * @typedef {Object} User * @property {number} id * @property {string} username * @property {string} [email] * @property {('admin'|'user'|'guest')} role * @property {() => string} getFullName */ /** @type {User} */ const currentUser = { id: 1, username: 'johndoe', role: 'admin', getFullName() { return 'John Doe'; } }; console.log(currentUser.role);
Expected console output:
admin