sync variables to javascript
progress
Sync before and after doing any javascript operations