-3

Have viewed

@propertyOrIdentifier // ? What does this mean and do?

used within apparent plain objects or class assignment at Questions and Answers at stackoverflow.

What is the @ symbol or character in javascript? What are valid uses?

guest271314
  • 1
  • 15
  • 104
  • 177
  • 3
    citation needed? The `@` symbol is used in e.g. Java for annotations, but not in JavaScript. It's also not legal within an identifier. – Alnitak Jan 04 '17 at 18:00
  • @Alnitak At the first question viewed that is now deleted, both `const a = {@b};` and `object.property .= @func;` were within body of Question. Second link is http://stackoverflow.com/questions/41430943/es6-am-i-using-classes-mixins-correctly-in-javascript where `import { readonly } from 'my-decorators';class Person { @readonly person ( ) { return this.user; } }` is used. – guest271314 Jan 04 '17 at 21:42

2 Answers2

1

It is called a decorator.

https://github.com/wycats/javascript-decorators

Medium - Exploring es7 decorators

KevBot
  • 17,900
  • 5
  • 50
  • 68
0

It doesn't have any special meaning in vanilla JS.

It's likely that wherever you are seeing it it is simply being used as a naming convention, similar to doing something like adding a preceding underscore for private variables _example

Pabs123
  • 3,385
  • 13
  • 29