We are using JavaScript constructor class to set data attribute values for ajax call

Below is the code snippet

”’

var FilterTest = class { 
constructor() { 
  this.data_scope= $("#ID").data('scope');
}; 
getAttrs() { 
 var Opts = {data_scope: this.data_scope};
 Opts['attr2'] = "ABC";
 return Opts;
 }  
}

Obj = new FilterTest();

$.ajax({
 url: URL,
 data: Obj.getAttrs(),
 dataType: 'json'
}).done

on live site that opts return empty hash in ajax call. This issue comes for some users

Constructor class return empty hash in some browsers