Why this does not work ? According to JQuery Document Ready - Multiple allowed? it should. It throws a "jQuery.Deferred exception: Dog is not defined ReferenceError: Dog is not defined"
$(function() {
  class Dog {
    constructor() {
    }
    bark(){
        console.log('bark')
    }
}
})
$(function() {
  var teckel = new Dog()
  teckel.bark()
})