encode/decode base64 with JS
encode,tipjs,base64
Encoding to base64 is done with the btoa command
btoa("This is a test.")
> "VGhpcyBpcyBhIHRlc3Qu"
To decode a base64 encoded string, use the atob command
atob("VGhpcyBpcyBhIHRlc3Qu")
> "This is a test."
Có thể bạn đã miss một số snippets code
Tránh viết biến có phạm vi global
Đôi khi bạn cần phải viết một tập lệnh trực tiếp trên trang. Cần lưu ý rằng trong code của bạn vô tình khai báo một biến toàn cầu. Vì phạm vi toàn cầu phức tạp hơn nên việc tìm kiếm chậm hơn rất nhiều
Rest Operator for Objects
Now we can use rest on the properties of an Object. It allows us to explicitly extract certain named variables, and assign any uncalled variables into a catchall Object.
Lấy tháng hiện tại trong javascript
Lấy tháng hiện tại trong javascript
lỗi access-control-allow-origin và cách khắc phục
lỗi access-control-allow-origin và cách khắc phục trong express, nodejs
encode/decode base64 with JS
Encoding to base64 is done with the btoa command