In all programming languages the use of methods is essential for the development of activities, with them you can reuse blocks of code throughout the project so that it is much easier to process or have return of certain information.

In Javascript, methods are called functions and are created using syntax function().


This type of function is declared to perform a given code block. Finished processing, the code continues to run again within the logic implemented.

<SCRIPT LANGUAGE=”javaScript” type=”text/javaScript”>
function hello() {
document.write (“Welcome.”);


This type of function returns a value from the source code implemented. This value is often used in another process, to return the information to return syntax is used, check out the example below:

<SCRIPT LANGUAGE=”JavaScript” TYPE=”text/javascript”>
function sum() {
return 10+5;

document.write (“10 + 5 = ” + soma() );


These functions are used when you need to process certain information from a variable informed by the developer.

<SCRIPT LANGUAGE=”JavaScript” TYPE=”text/javascript”>
function mostrar (msg){
document.write (msg);

function sum(x, y){
return x+y;

var resultado;
mostrar (” 20 + 30 =“);
result = sum(20, 30);


All formats functions are used in everyday life of a programmer at all is because of this pattern that we can work any kind of logic programming.

Want to test our examples and learn more about one of the tools of development the fastest growing market? Then download the free version already Scriptcase and start today to enjoy all the benefits of our tool.

By ,

August 9, 2013


You might also like…

5 reasons you can’t miss a Black Friday Scriptcase!

This November we bring you the biggest and most important discounts of the year! And do you know wh...

Taking a look at Scriptcase version 9.7

After the big Scriptcase 9.7 presentation event, we have a new version of Scriptcase for download, ...

October Newsletter

Follow the latest news for the month of October! Webinars, blog posts, videos, and more. WEB...

You might also like…

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at Learn more about our Privacy Police.