var controls_string = '{!!json_encode($controls, JSON_HEX_APOS) ?? ""!!}';
controls_string = controls_string.replace(/[\u0000-\u0019]+/g,"");
var controls = JSON.parse(controls_string);
or shorter version
var controls = JSON.parse('{!!json_encode($controls, JSON_HEX_APOS) ?? ""!!}'.replace(/[\u0000-\u0019]+/g,""));
by გიორგი უზნაძე
3 years ago
0
Pro tip: use ```triple backticks around text``` to write in code fences