Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
In this update, I corrected the documentation for the splice method to improve clarity and accuracy. Specifically, I changed the word “pos” to “start” in the comments to match the variable name used in the code. 

This change helps to clearly indicate that the start parameter determines the position in the array where the method begins removing elements.
  • Loading branch information
Lacertilia1 authored Aug 1, 2024
1 parent 4aee293 commit a6076c5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const deleteCount = 2;

const removedItems = vegetables.splice(start, deleteCount);
// так можно удалить элементы, deleteCount определяет количество элементов для удаления,
// начиная с позиции(pos) и далее в направлении конца массива.
// начиная с позиции(start) и далее в направлении конца массива.

console.log(vegetables);
// ["Капуста", "Морковка"] (исходный массив изменён)
Expand Down

0 comments on commit a6076c5

Please sign in to comment.