JavaScript Flashcards
What is JavaScript
JavaScript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive.
How to open Developer Tools in Google Chrome ?
Keyboard Shortcut is :-
ctrl + shift + i
How to open console in Google Chrome ?
KeyBoard Shortcut is :-
ctrl + shift + j
Hot to write JS code from Google Chrome Console ?
Open Console window , & start typing JS code , hit enter to run code ?
How to Use alert in JS ?
alert + brackets + message to display in double quotes
alert(“Java Script is Fun”)
How to Declare variables in Java Script ?
We have 5 ways to Declare a Variable :-
- let age = 25;
- var countryName = ‘India’
- const year = 1998;
- let firstName; //undefined
- lastName; // Dynamic Typing
How to write if Condition in Java Script ?
if keyword + condition in brackets + action statements in curly braces
let a = 10;
if (a==10) alert('Java Script is FUN! '); or if (a==10){ alert('Java Script is FUN! '); }
How to write JS code inside a HTML Document ?
We have to use script element .
<
script>
<
/script>
How to get connected with google console ?
We have to use console.log method .
console.log(4+5+6+7+8)
How to load JavaScript file ?
We have to use script element under body of HTML Document .
<
script src=”script.js”><
/script>
How to load JavaScript file ?
We have to use script element under body of HTML Document .
<
script src=”script.js”><
/script>
What is an values in JavaScript ?
Value is an piece of Data.
It is the most fundamental unit of information in programing .
What is an values in JavaScript ?
Value is an piece of Data.
It is the most fundamental unit of information in programing .
How to Declare a variable in JavaScript ?
let fitstName= “Hemant”
How to Declare a variable in JavaScript ?
let fitstName= “Hemant”
How to pass an varaibale to Browser console ?
let firstName = "Hemant" ; console.log(firstName) ;
What you include in Variable name ,according to naming convention in JvaScript ?
The variable name only contains ,letters,numbers,undercore & dollar
By which JavaScript variable starts with,according to conventions ?
JavaScript variables only starts with
lowercase letters,underscore or Dollar ?
How many Data Types are in JavaScript ?
Two Types :-
Primitifve & Objects
What are the Primitive Data Types in JavaScript ?
We have total Severn Data Types in JavaScript ?
- Number - let age=23;
- String - let firstName = “Hemant”;
- Boolean - isMale = true
- Undefined - let children;
- Null
- Symbol
- BigInt
What is dynamic typing in JavaScript ?
It means automatic detection of data type
We dont have to manually define the data type,data types are determined automatically by JavaSript when it detects the value.
firstName = “Hemant”
JS automatically consider this as string data type.
How to know the type of value by chrome console ?
console. log(typeof true)
console. log(typeof javaScriptIsFun)