Break and continue statement Issue

Why does break; and continue; statements are giving error in custom script in erpnext v11 while they were working in v10. I tried to search alot in Google regarding the same that is there something that is depreciated in ES6 Javascript standards but cant find anything.

Any help/suggestions please

What error does it give?

error in custom script. Same script was running in v10 but not in v11

setup@http://my ip/assets/js/form.min.js?ver=1544730711.0:1:59918
_f.Frm.prototype.setup@http://my_ip/assets/js/form.min.js?ver=1544730711.0:1:13013
_f.Frm.prototype.refresh@http://my_ip/assets/js/form.min.js?ver=1544730711.0:1:18904
load@http://my_ip/assets/js/form.min.js?ver=1544730711.0:1:11490
show_doc/<@http://my_ip/assets/js/form.min.js?ver=1544730711.0:1:11368
callback@http://my_ip/assets/js/desk.min.js?ver=1544730711.0:1:114503
success@http://my_ip/assets/js/desk.min.js?ver=1544730711.0:1:48695
Rollup

Still same issue. Even a simple loop condition is giving this issue when using break / continue statement.