Connecting...

This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of JavaScript
For more information, please see full course syllabus of JavaScript
JavaScript Functions
Lecture Description
In this lesson our instructor talks about functions. He starts with questions and answers. Then he talks about two main types of functions such as JavaScript library functions and programmer-defined functions. He discusses library functions and shows some examples. He talks about procedure and function definition syntax for programmer-defined functions. Seven complete example videos round up this lesson.
Bookmark & Share
Embed
Share this knowledge with your friends!
Copy & Paste this embed code into your website’s HTML
Please ensure that your website editor is in text mode when you paste the code.(In Wordpress, the mode button is on the top right corner.)
×
Since this lesson is not free, only the preview will appear on your website.
- - Allow users to view the embedded video in full-size.
Next Lecture
Previous Lecture
1 answer
Last reply by: Hong Yang
Wed Sep 16, 2020 4:23 PM
Post by DJ Sai on August 9, 2018
How is no one realizing the square of number "x" should be x*x, not x*x*x?
0 answers
Post by Ebssa Tesema on July 1, 2015
Hei
Why do we need the function square (y)? how do we manage to exchange the values between x and y.
I see we have var x in the for loop where it is going to increment to 10; i also understand that we havn't given the square (x) function it is proper calculation instead we used function square (y);
and we are getting the result!!! ok but what does it mean to pass data?
can you please answer this question??
1 answer
Sun Feb 2, 2014 3:45 PM
Post by lae loe on January 28, 2014
Hello Maurry... I try this code and java script said missing radix parameter..
these are the two codes that show mssing radix parameter and the exponent didn't work..
original = parseInt(form.original.value);
exponent = parseInt(form.exponent.value);
function getExponent(){
var form = document.getElementById("exponentForm");
var original;
var exponent;
original = parseInt(form.original.value);
exponent = parseInt(form.exponent.value);
form.result.value = numP(original,exponent);
}
function numP(original, exponent)
{
var result = 1;
for(var i = 0; i <exponent; ++i);
result *= original;
return result;
}
1 answer
Sun Feb 2, 2014 3:43 PM
Post by lae loe on January 28, 2014
Hello Maurry... I try this code and java script said missing radix parameter..
these are the two codes that show mssing radix parameter and the exponent didn't work..
original = parseInt(form.original.value);
exponent = parseInt(form.exponent.value);
function getExponent(){
var form = document.getElementById("exponentForm");
var original;
var exponent;
original = parseInt(form.original.value);
exponent = parseInt(form.exponent.value);
form.result.value = numP(original,exponent);
}
function numP(original, exponent)
{
var result = 1;
for(var i = 0; i <exponent; ++i);
result *= original;
return result;
}
1 answer
Tue Nov 13, 2012 4:53 PM
Post by Clarence Eppinger on November 12, 2012
where and how does the value of "y" get set tto the current value of "x"?
0 answers
Post by Grady Ela on June 4, 2012
I am curious as to why the variable "x" is used at the top in the "for" statement but the variable "y" is used in the function. I noticed that they are interchangeable if you change all of the variables but I would like some clarification.
Thanks!
0 answers
Post by Jorge Guerrero on March 31, 2012
Very illustrative. I'm getting closer to deploying web applications the way I do in MS Access.
What I've noticed is that commercial languages such as VBA and VB are similar to echother, but open source langauges such as JavaScript and PHP are more similar to eachother.
Nevertheless, MS Access is a good start to manage desktop databases and from there mimic web applications for the same power.
Both are useful.