record repeatCount in js variable