Sau đây cho biết biểu thức "true instanceof Boolean" đánh giá sai. Tại sao biểu thức này lại đánh giá sai?Tại sao 'true instanceof Boolean' bằng false trong JavaScript
$(document).ready(function() {
var $result = $('#result');
if(true instanceof Boolean) {
$result.append('I\'m a Boolean!');
} else {
$result.append('I\'m something other than a Boolean!');
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="result"></div>
Điều bạn có thể muốn cho cụm từ của mình là 'typeof true == 'boolean'' – Shashank