Arrays
and Functions
ARRAY
[]
Array vs List
new Array() vs []
var arr_var = []
array_var[0]
array_var.length
push (el)
&
unshift (el)
&
shift (el)
&
pop (el)
slice (i, count, els)
&
splice (i, count, els)
&
join(separator)
&
revers...
FUNCTION
function fnc_name() {
// function body
}
var fnc_var = function() {
// function body
}
Declare Call
Declare Call
Recursion
Declare Call
Recursion
Parameters Arguments
function fnc_name( par1, .. , parN ) {
// function body
}
Parameters
function fnc_name( par1, .. , parN ) {
}
Parameters
arguments
Declare Call
Side Efect
return
function fnc_name( par1, .. , parN ) {
return “Some result”;
}
side efects
Declare Call
SCOPE
function fnc_name( par1, .. , parN ) {
var inner_var = 5;
}
console.log(inner_var) // undefined
Upcoming SlideShare
Loading in …5
×

Arrays and Functions in JavaScript

1,405 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,405
On SlideShare
0
From Embeds
0
Number of Embeds
311
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • typeof (variable)
  • typeof (variable)
  • Arrays and Functions in JavaScript

    1. 1. Arrays and Functions
    2. 2. ARRAY
    3. 3. []
    4. 4. Array vs List
    5. 5. new Array() vs []
    6. 6. var arr_var = []
    7. 7. array_var[0]
    8. 8. array_var.length
    9. 9. push (el) & unshift (el) & shift (el) & pop (el) slice (i, count, els) & splice (i, count, els) & join(separator) & reverse()
    10. 10. FUNCTION
    11. 11. function fnc_name() { // function body }
    12. 12. var fnc_var = function() { // function body }
    13. 13. Declare Call
    14. 14. Declare Call Recursion
    15. 15. Declare Call Recursion Parameters Arguments
    16. 16. function fnc_name( par1, .. , parN ) { // function body } Parameters
    17. 17. function fnc_name( par1, .. , parN ) { } Parameters arguments
    18. 18. Declare Call Side Efect return
    19. 19. function fnc_name( par1, .. , parN ) { return “Some result”; } side efects
    20. 20. Declare Call SCOPE
    21. 21. function fnc_name( par1, .. , parN ) { var inner_var = 5; } console.log(inner_var) // undefined

    ×