-
-
Save conanak99/1b745bfe98c31d0f0d8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tìm max bằng cách gọi hàm Math.max | |
Math.max(4, 3, 2, 10); | |
// Thay vì gọi trực tiếp hàm Math.max, ta có thể dùng call | |
// Set this bằng null | |
Math.max.call(null, 4, 3, 2, 10); | |
// Apply tương tự call, nhưng không truyền lần lượt | |
// Mà truyền một array chứa toàn bộ các tham số | |
Math.max.apply(null, [4, 3, 2, 10]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment