-
-
Save conanak99/64d2878cb86324b6b49c 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
function log(level, time, message) { | |
console.log(level + ' - ' + time + ': ' + message); | |
} | |
// Không có this nên set this là null | |
// Set mặc định 2 tham số level và time | |
var logErrToday = log.bind(null, 'Error', 'Today'); | |
// Hàm này tương ứng với log('Error', 'Today', 'Server die.') | |
logErrToday("Server die."); | |
// Error - Today: Server die. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment