How to reverse an Array?

array,tipjs

Reversing an array in JS is really simple with the standard array method. Like below 

const str = ['a', 'b', 'c', 'd', 'e'];
console.log(str.reverse());
// Output: > Array ["e", "d", "c", "b", "a"]

Without using reverse() method:

const str = ['a', 'b', 'c', 'd', 'e'];
const str1 = [];
  for (let i = str.length - 1; i >= 0; i--) {
str1.push(str[i]);
  }
console.log(str1);
// Output: > Array ["e", "d", "c", "b", "a"]

Có thể bạn đã miss một số snippets code

snowflake là gì

snowflake là gì? Năm 2010, Twitter có nguồn mở Snowflake, một thuật toán tạo ID duy nhất trên toàn cầu được sử dụng bởi nhóm nội bộ của nó, được dịch thành Snowflake.

Hàm lày ngày trong tuần javascript

Hàm lày ngày trong tuần javascript

Filter Unique Values

Kiểu đối tượng Set đã được giới thiệu trong ES6 và cùng với ..., ‘spread’ operator, chúng ta có thể sử dụng nó để tạo một mảng mới chỉ với các giá trị duy nhất.

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

Convert Array-like to True Array

Convert Array-like to True Array