3 > Math.pow(11, 0.5)
const arr = [
{ val: 1, from: 0, to: 25 },
{ val: 2, from: 9, to: 13 },
{ val: 3, from: 14, to: 20 }]
const output = arr
.map(el=>[el.from, el.to])
.flat()
.sort((a,b)=>a-b)
.map((el, index, array)=>array[index+1] && [el, array[index+1]])
.filter(el=>el)
class CRUD {
repository = null;
constructor(selectedRepository){
this.repository = selectedRepository;
}
someCRUDmethod(){
return this.repository.getSome();
}
}
class Current extends CRUD{
constructor(repo){
super(repo);
}
}
export default new Current(someRepo);