Forum Discussion

jbrave's avatar
jbrave
Channel Surfer
15 years ago

"m." is this a system keyword?

The reference manual very breifly mentions m. as follows:
The "this" pointer is "m".


Is this really true, or is m. no different from any other alphabetic character with a . after it?

The manual could really use a lot more detail about some of these things.

2 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert
    m is analogous to this. Don't try to use it for any other purpose or you will have problems. It's not exactly a reserved word, but you certainly can't have any variables named 'm' since it's already being used as a variable name.

    -JT
  • If in a method of a class/object, m refers to the roAssociativeArray that contains the instantiation. If in a plain function, m refers to the global object. This can be handy if you want a plain function with state.