เมธอด JavaScript console.log() ใช้สำหรับเขียนข้อความในคอนโซล
ต่อไปนี้เป็นรหัสสำหรับ JavaScript console.log() วิธีการ -
ตัวอย่าง
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
</style>
</head>
<body>
<h1>console.log() Example</h1>
<button class="Btn">CLICK HERE</button>
<h3>Click the above button to see output in your console</h3>
<script>
let test = {
a:22,
b:'HELLO',
c:44,
}
console.log(test);
console.log('HELLO WORLD');
</script>
</body>
</html> ผลลัพธ์

เมื่อคลิกปุ่ม “คลิกที่นี่” -
