String.prototype.trimEnd

es10,function

trimEnd() Phương thức xóa khoảng trắng từ đầu chuỗi và trả về một chuỗi mới. Có nghĩa là trimEnd() xoá những ký tự space bên phải mà không làm thay đổi chuỗi gốc.

let pingan8787 = '   Hello pingan8787!   ';
console.log(pingan8787);        // "   Hello pingan8787!   ";
console.log(pingan8787.length); // 23;

console.log(pingan8787.trimEnd());        // "   Hello pingan8787!";
console.log(pingan8787.trimEnd().length); // 20;

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

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.

Object.fromEntries

Object.fromEntries Là một phương thức mới được giới thiệu trong ES10 được sử dụng để chuyển đổi từ list có dạng key và value thành những objects.

try/catch es10

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

Lấy tháng hiện tại trong javascript

Lấy tháng hiện tại trong javascript

Optional chaining javascript

Optional chaining javascript