Skip to content

Commit

Permalink
add raid at test and implementation b00tc4mp#160
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbarzi committed Sep 30, 2024
1 parent 7275754 commit 7c27018
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions staff/manuel-barzi/playground/raids/Raid.prototype.at.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var Raid = function () {
this.length = 0
}

Raid.prototype.at = function (index) {
var element = this[index]

return element
}

console.log('TEST Raid.prototype.at')

console.log('CASE get number at index 3 in nums')

var nums = new Raid
nums[0] = 100
nums[1] = 200
nums[2] = 300
nums[3] = 400
nums[4] = 500
nums.length = 5

var num = nums.at(3)
console.log(num)
// 400

0 comments on commit 7c27018

Please sign in to comment.