DIGITAL UNIVERSITY OF CAMBODIA
JAVASCRIPT
Faculty Of Digital Industry
Dariya Thorn
T
I
T
L
E
01
1.Introduction to JavaScript
2.Variables and Data Types
3.Syntax and Statements
4.Objects and Arrays
5.Document Object Model
6.Debugging and Error Handling
7.Modern JavaScript
8.Working with JSON
9.Modules and Functions
មេម ៀនទី
១
មេម ៀនទី១
Introduction
to JavaScript
Agenda
1.What JavaScript is and its history.
2.How to include JavaScript in HTML
3.Using the console to test and debug code.
JavaScriptis a programming language that developers use to
make interactive webpages.
History of JavaScript
• JavaScript was created by Brendan Eich at Netscape
Communications in just 10 days in May 1995.
• Initially, it was called Mocha, then renamed to LiveScript, and
finally JavaScript.
How to include JavaScript in HTML
There are three main ways to include JavaScript in an HTML
file:
1.Inline JavaScript
2.Internal JavaScript
3.External JavaScript
How to include JavaScript in HTML
1.Inline JavaScript
How to include JavaScript in HTML
1.Internal JavaScript
How to include JavaScript in HTML
1.External JavaScript
File HTML
File JavaScript
console is a powerful tool for debugging, View error messages and
testing JavaScript code.
Using Console:
In JavaScript always use console.log() to print information or
document that they want to console.
Using the console to test and debug code
Using the console to test and debug code
Testing Console warning or error
Out put
Using the console to test and debug code
Testing Console array object
Out put
Using the console to test and debug code
Testing Console assert
Out put
1.console.log
2.console.clear
3.console.error
4.console.warn
5.console.info
6.console.assert
7.console.count and countReset
8.console.group and groupEnd
9.console.table
10.console.time and timeEnd
11.console.trace
Using the console to test and debug code