Professional Documents
Culture Documents
REVISION
document.write(Month31.push("DEC")) 4
document.write(Month31.unshift("JAN")) 5
document.write(Month30.pop()) NOV
document.write(Month30.shift()) APR
document.write(Month31.splice(1,0,"FEB")) It will show nothing as splice return deleted
element but change the original array
document.write(Month31.slice(2,5)) MAR,JUL,OCT
document.write(Month30.concat(Month31)) JUN,JAN,FEB,MAR,JUL,OCT,DEC
document.write(Month31.sort()) DEC,FEB,JAN,JUL,MAR,OCT
document.write(Month31.reverse()) OCT,MAR,JUL,JAN,FEB,DEC
document.write(Month31.length) 6
STR= "FAIPS-KUWAIT-2019"
document.write(STR.toUpperCase()) FAIPS-KUWAIT-2019
document.write(STR.slice(2,6)) IPS-
document.write(STR.substr(2,6)) IPS-KU
document.write(STR.substring(2,6)) IPS-
document.write(STR.charAt(2)) I
document.write(STR.indexOf('P')) 3
push() pop()
Push method is used to add one or more items to pop() method removes the last element from array
the end. and return it
This method changes the original array. This method changes the original array
The return value of the push method is the new length The return value of the pop method is the removed
of any array item.
var fruits = ["Banana", "Orange", "Apple", "Mango"]; var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.push("Grapes")+"<br>") // document.write(fruits.pop()+"<br>")
output 5 //output Banana
document.write(fruits)//output document.write(fruits)// output
Grapes,Banana,Orange,Apple,Mango Orange,Apple,Mango
slice() splice()
slice() method is used to extract values from array The splice() method adds/removes items to/from
from start index position to end-1 index position an array, and returns the removed item(s).
This method does not changes the original array. This method changes the original array.
arr1=[2,4,6,8,10,12,14,16] var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(arr1.slice(4,7)) )) // output 10,12,14 fruits.splice(2, 1, "Lemon", "Kiwi");
document.write(arr1.slice(-6,4)) // output 6,8 document.write(fruits)//output
document.write(arr1.slice(-6,-4)) )) // output 6,8 Banana,Orange,Lemon,Kiwi,Mango
document.write(arr1.slice(2,-3)) )) // output 6,8,10
If only start is given than all elements from start
index till end will be extracted
If negative index is given in start then from right hand
side indexing will be done last element will be -1
index
join() concat()
join() method is used to combine the elements of concat method is used to combine two or more
array into string using separator arrays or values
arr1=["Sun","Mon","Tue"] arr1=["Sun","Mon","Tue"]
document.write(arr1.join(‘@’)) //output arr2=["Wed","Thu","Fri"]
Sun@Mon@Tue arr3=arr1.concat(arr2)
document.write(arr3) // output
Sun,Mon,Tue,Wed,Thu,Fri
arr3=arr2.concat(arr1, “Sat”) //output
Wed,Thu,Fri,Sun,Mon,Tue,Sat
charAt() indexOf()
The charAt() method returns the character at the The indexOf() method returns the position of the
specified index in a string. first occurrence of a specified value in a string.
The index of the first character is 0, the second This method returns -1 if the value to search for
character is 1, and so on. never found. The indexOf() method is case
sensitive.
Sort method is used to sort array string element in The reverse() method reverses the order of the
ascending order elements in an array. This method changes the
original array.
var fruits = ["Banana", "Orange", "Apple", "Mango"]; var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits +"<br>") document.write(fruits.reverse()+"<br>")
document.write(fruits.sort()+"<br>") document.write(fruits)
output output
Banana,Orange,Apple,Mango Mango,Apple,Orange,Banana
Apple,Banana,Mango,Orange Mango,Apple,Orange,Banana
Actual parameter Formal Parameter
Parameter used during function calling are called Parameter used in function header are called formal
actual parameter parameter
Actual Parameter can be variable, constant, or Formal parameter can be only variable
expression
Example:
<script>
function add(a, b) //a and b are formal parameters
{
sum = a+b;
document.write("Sum = "+sum);
}
x = 10, y = 20;
Variable declare inside function or block using var Variable is declared outside any function or block are
keyword are called local variable. called global variable.
Variable declare inside function or block without Variable declare inside function without var keyword
using var keyword is not local variable also has global scope
Local variable can be used only within the function Global variable can be used anywhere in script .
in which they are declared not outside
function add(x,y) // formal parameters are always local variable
{
z=x+y // z declare without var keyword will be treated as global variable
}
add(10,8) // function call will execute add function and calculate z =10+8
document.write(z) // output will be 18 as z has global scope can be used outside function
break break is used to exit the block or loop immediately without executing further code of
that block or loop. Control moves out of loop or block
continue continue is used to move to next iteration of loop with executing current iteration given
after continue
Conditional Conditional operator is also known as ternary operator as it required three operand
operator and two operator ? :
Syntax (condition) ? code if condition is true : code if condition is false
Example
(Age>18)? document.write(“You Can Vote”) : document.write(“You cannot Vote”)
prompt() prompt() method is used to ask user to input value from user in a dialogue box. Value
enter in prompt can be stored in variable when user click on Ok button
Name =prompt(“Enter your Name “)
alert()
alert () method is used to display message or value in a dialogue box.
Name =prompt(“Enter your Name “)
alert(“Your Name is=”+Name)
it has one button Ok when user click on OK button alert dialogue box close
confirm() Confirm method is used to ask you’re a question to confirm something .it has two
button ok and cancel
if user click on Ok button 1 is return and if click on cancel button 0 is return
9. To add Title in the Beginning and Credit in end and increase the time span
Click Tools”Titles and Credits”
Click the link that corresponds to the location where title or credit is to be inserted select at beginning.
In the “Enter text for title” box, type the title or credit.
Click ‘Add title’ button.
To change the animation click ‘Change the animation’ and select the desired animation from the list.
To change the font or color of the title/credit, click the ‘Change the text font and color’, and select the
desired font face, color, background color, formatting, etc.
Select the Audio you want to edit or change timing on Timeline view
Use the drag handle from end to trim by moving inward or to increase the time, move the drag
handle outward or forwad
Task Pane
The Movie Tasks Pane provides an outline of the video editing process in Windows Movie Maker. Each
of the three steps listed in the Movie Tasks Pane
1 Capture Video – it contain option to import audio, video and pictures to your collection
2. Edit Movie- it has option to add transitions, video effects, and title and credit for movie
editing
3. Finish Movie- option to save and publish your movie at different place like computer ,DVD,CD,
Emails etc
Each includes links for the tasks you would perform for that step. When you click on any
of inks, Windows Movie Maker will start a wizard that will guide you through the task
Preview Monitor
The preview monitor enables us to view individual clips or an entire project. By using the preview
monitor, we can preview our project before publishing it as a movie. We can use the buttons
underneath the preview monitor to play or pause a clip, or to advance or rewind a clip frame-by-
frame.
The Split button allows us to split a clip into two parts at the point displayed in the
preview monitor.
Content pane
The Contents pane displays the clips that are contained in the collection that is selected in the
Collections pane. The Contents pane displays all of the video, audio, pictures, video transitions, and
video effects that can be added to the storyboard/timeline to include in your movie.
Contents pane has two views:
Two views of content pane Details and Thumbnails.
In Thumbnails view content are shown as image
In Details view content are shown as list with information like filename, type, duration, size etc.
Collection Pane
The Collections Pane displays our collection folders, which contain clips. The collection
folders appear in the Collections pane on the left, and the clips in the selected collection
folder are displayed in the Contents pane on the right.
Story Board
Storyboard. The storyboard is the default view in Windows Movie Maker. We can
use the storyboard to look at the sequence or ordering of the clips in your project and
easily rearrange them, if necessary. This view also let us see any video effects or
video transitions that have been added. Audio clips that have added to a project are
not displayed on the storyboard, but we can see them in the timeline view. The following
picture shows the storyboard view in Windows Movie Maker
Time Line
Timeline: The timeline view provides a more detailed view of our movie project and allows
us to make finer edits. Using this timeline view, we can:-
1) Trim video clips,
2) adjust the duration of transitions
between clips,
3) view the audio track.
4) Review or modify the timing of clips.
5) Adding title overlay