Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanadft committed Sep 28, 2023
2 parents d479da5 + 10c20a3 commit b4d34df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions content/snippets/js/s/data-structures-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class Queue {
this.items.push(item);
}

dequeue(item) {
dequeue() {
return this.items.shift();
}

peek(item) {
peek() {
return this.items[0];
}

Expand All @@ -50,7 +50,7 @@ class Queue {
```

- Create a `class` with a `constructor` that initializes an empty array, `items`, for each instance.
- Define an `enqueue()` method, which uses `Array.prototype.push()` to add an element to the end of the `items` array.
- Define an `enqueue()` method, which uses `Array.prototype.push()` to add an element, `item`, to the end of the `items` array.
- Define a `dequeue()` method, which uses `Array.prototype.shift()` to remove an element from the start of the `items` array.
- Define a `peek()` method, which retrieves the value of the first element in the `items` array, without removing it.
- Define an `isEmpty()` method, which uses `Array.prototype.length` to determine if the `items` array is empty.
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const currentYear = new Date().getFullYear();
<p class='fs-xs lh-loose mt-0.5 mb-2 mx-2'>
Website, name & logo &copy; 2017-{currentYear}
<a
class='inline-block'
class='inline-block ml-1'
href={settings.githubOrgUrl}
rel='noopener noreferrer nofollow'
target='_blank'>{settings.orgName}</a
Expand Down

0 comments on commit b4d34df

Please sign in to comment.