How to access model from Javascript

How can one access the views model from a Javascript function please?

Thx.

Inside the template? this.modelProperty
Outside the template? theElement.modelProperty