JAVASCRIPT COURSE CONTENT
1. INTRO TO JAVASCRIPT
Java != JavaScript (LiveScript)
Initial Netscape, IE and now all the browsers
Anybody can learn
Basic HTML knowledge is a better option.
Text Editor, Browser (Console)
Case Sensitive; Camel Case
1.Difference between Scripting & Programming Language
(JS scripting or programming------.> Wikipedia
2.Difference between Client End & Server End Programming/Scripting
2. WHY NEED TO BE MAINTAINED AT EXTERNAL FILE
We can avoid the messy look
Perform Better & Faster
Body Part (at least some content start to display on browser immediately)
Head Part (Analytical tariff will be easy part)
Head /Body/after Body/After Html end àwhich is best y?
<script> </script>
<noscript> </noscript>
3. PRINTING METHODS IN JAVASCRIPT
Console.log()
document.write()
alert (“ “)
prompt(“enter anything”) ----->its always a string
inner.HTML
How to print the output in the browser instead of console
4. COMMENT
Single line //
Multiline /* */
Inline //
5. VARIABLE (var)
Variable is a place helps to store the data temporary.
The first digit will be always alphabets It accepts both cases, numeric value and dollar symbol.
Difference between const and let
6. DATA TYPES
Number
String
Boolean
Undefined
Nan
Null
Array
Object
Difference between var a=0; and var a=null;
Primitive and Non Primitive Data Type
typeof/ instanceof
7.OPERATORS
Arithmetic Operators (+, -, *, / ,** , %, ++, --)exponentiation
Assign Operators( x+=y;x=x+y)
Concatenation
Comparison Operators (==,!=,>,<,>) different data types (===,!==)
Logical Operator (AND &&, OR||, NOT!)
C= a+Number(b) (or) c = a+parseInt(b) (or) c= a+parseFloat(b)
C=a+ +b
Ternary Operator (T/F ? T: F)
Unary Operator
Bitwise Operator/zero fills
8. GENERAL TERMS
Operator
Expression
Statement
Block
Keyword
Identifier
Reserved Words
9. CONDITIONAL STATEMENT
if
else
else if
switch
10. NUMBER
Integer, Float-->Number
STRING TO NUMBER CONVERSION
Number()parseInt()
parseFloat()
+
toFixed() -->it will be string
Math.round()
Math.sqrt()
Math.abs()
Math.ceil() -->4.4-->5
Math.floor()-->4.7-->4
Math.min
Math.max
0.1+0.2=0.300000004 but 1.1+1.2=2.3 why?
11.STRING
String can be declared with single or double quote
If u want to print quote inside the string then we need to choose declaration single or double quote depend upon the quote inside the string.
I’m ok --> “I’m ok”
he is “Mr.Perfect” --> ‘he is “Mr.Perfect”’
Add -->Concatenation
Sub,mul,div asusal
Slice -->a.slice(2) (2,7) (-3.-1)
Replace -->a.replace( , )
a.replace(/ /g , )
a.replace(/ /i , )
a.replace(/ /ig, ) or a.replace(/ /ig, )
Split -->a.split(‘’)
a.split(‘,’)
a.split(‘ ‘)
12. BOOLEAN
a = any number except zero is true
a= any string is true; just a quote without space is false
a=null;a=NaN;a=Undefined are false
13. ARRAY
Helps to store a list of value [allows mixed data type values too]
Index starts from Zero and length starts from the count 1
It consists only numbered index.
Array.length ; a.indexOf()
a[index]
a.push() a.pop() -->Deals with last index
a.shift() a.unshift() -->Deals with zeroth index
delete a[] --> delete and create empty slot
how can I delete a element of array without creating empty slot
how can I insert any element in the array at decided index
Concatenation --->a.concat(b,c)
Slice --->a.slice(2) (2,5) ---->second index to 4th index
Splice ---->a.splice(2,5) --->2nd index to next 5 index elements
Join
a.sort() --->Non Numeric Value;
a.sort(function(a,b){return a-b}) ---->Numeric value
a.reverse()
14. OBJECT
It’s a kind of array, stored and accessed with Named index;
Object.keyname or object[“key name”]
Comments
Post a Comment