Why does this throw an error , and log undefeined results ? class Lengths {…
- User
Why does this throw an error , and log undefeined results ?
class Lengths {
codeconstructor(firstLength , secondLength , thirdLength) { this.items = [this.firstLength , this.secondLength , this.thirdLength] }setLengths(set1 , set2 , set3){ this.firstLength = this.items[0] this.secondLength = this.items[1] this.thirdLength = this.items[2] }
getLengths(){ return [this.items[0] , this.items[1] , this.items[2] ] }
static getLengths(){ return [this.items[0] , this.items[1] , this.items[2] ] }
}
let instance = new Lengths(2,4,8)
instance.setLengths(3,5,9) console.log(instance.getLengths())
class MoreLengths extends Lengths {
code
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.