JSFiddle - React, Tailwind, and code Playground

Javascript quick lesson 3

by Ryan Brown

HTML

<title> JS</title>

<body>

<div class"=container">
<div class="jumbotron">
<h1>Leats Learn Javascript!</h1>
<p class="lead">...cause Javascript ROCKS.</p>
</div>
</div>

<script></script>
</body>

JavaScript

//JavaScript quick lesson 3 Functions Tutorial


//This Javascript tutorial covers functions in Javascript. Functions are a great way to store your code in reusable pieces of Javascript code that can be run at any time.


//when using the script tags to insert javascript directly into HTML. see above for example
		//when using the script tags inserting them just before the closing body tag will allow for a faster feeling webpage
    
 //Script examples withouth spaces
//< script>
//alert();
//< /script>
    

//< script src="">< /script>
//multiple without spaces
//< script src="">< /script>
//< script src="">< /script>
//< script src="">< /script>

//breaking it down into several files to make it easier to contain


//FUNCTIONS A FUNCTION IS A PIECE OF CODE THAT DOES ONE OR MORE ACTIONS
//this function is titled 'go' and will prompt to back to back alerts when called. 

/* function go(){
alert("hi");
alert("hey there");
}

go();
*/
//functions can be called an indefinite amount of times
//go(); go(); go();


//functions accept arguments. Below is an example of an argument
		//the fnction is called with go similar to above however now, the call will also insert the variables such as name and age below. this can contiued to be called different values for the variables. 

function go(name, age){
alert(name);
alert(age);
}

go("Ryan", 23);
//this can continued to be called like so:
go("Jake", 28,);
//I suspect this will become imprudent to continuing. as these variables could be automatically filled in via a second..third...and function/argument. Is this where the script files can come in handy? each time an argument is made with a list would it be best to self contain each one and link?

//arguments allow basic called variables to be reusable, quickly. 

//DRY CODE Don't Repeat Yourself