This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Brian Byle
Posted Jun 11 - Read on Facebook

Hello all. It's the weekend and the brain is a bit tired. Can you help clear something up for me?

Created a class with custom properties:

class Beer
Constructor: ->
@type = "IPA"
@price = 5
myBeer = new Beer
print myBeer.type

This returns "IPA" as desired.

If I remove the "@" symbol before each property it returns UNDEFINED.

Why? Also is this the correct way to create a custom class with custom properties?

Thx in advance!

2 Comments

Koen Bok

Yes it is. The @ stands for "this" which (in this context) means "this instance".

Brian Byle

Sweet thx. Like I said brain is fried . Time to create an instance of Beer in my house!

Read the entire post on Facebook