Skip to content

add solution to individual lab#2518

Open
Chinonye1 wants to merge 1 commit into
ironhack-labs:masterfrom
Chinonye1:master
Open

add solution to individual lab#2518
Chinonye1 wants to merge 1 commit into
ironhack-labs:masterfrom
Chinonye1:master

Conversation

@Chinonye1
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings May 25, 2026 15:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Implements a functional SortedList class and adds Mocha to the project to support testing.

Changes:

  • Implemented SortedList storage, sorted insertion, and aggregate/query methods (get, min, max, sum, avg).
  • Added Mocha as a project dependency in package.json.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
package.json Adds Mocha dependency (enables running tests).
index.js Implements SortedList behavior (sorted insertion + numeric helpers).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
"author": "fer@ironhack.com",
"license": "MIT"
"license": "MIT",
"dependencies": {
Comment thread index.js
Comment on lines +2 to +6
constructor() {
this.items=[]
this.length=this.items.length

}
Comment thread index.js
Comment on lines +22 to +30
max() {
if (this.length === 0) throw new Error("EmptySortedList");
return Math.max(...this.items);
}

min() {}
min() {
if (this.length === 0) throw new Error("EmptySortedList");
return Math.min(...this.items);
}
Comment thread index.js
Comment on lines +3 to +8
this.items=[]
this.length=this.items.length

}

add(item) {}
add(item) {
Comment thread index.js
this.length = this.items.length;
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants