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.
This is a Free Javascript Course designed for beginners. These Javascript lessons cover the basics of Javascript and programming basics from the very beginning.
In the first 2 lessons, we covered variables, several Javascript types, if else statements & comparison operators. Now, we’ll cover functions.
How I did livereload: https://www.youtube.com/watch?v=q78u9lBXvj0
You can also use the http://brackets.io editor – they have a great feature called “live preview”
Amazon Auto Links: No products found.
can someone show the css for this page?
Hey, i know it’s an eternity later, but what do you use to build the code, cuz i’m using Node.js and it dosen’t see commands like alert and prompt. Says they are undefined.
“You need a website. WHy not do it with WIx?”
*banjo strumming*
that ad gets VERY annoying after a while xD
how about when you have bootstrap because when i did it it didn’t do what it was supposed to
pretty hard to take in the first few times
For those like me who were wondering the syntax theme is called Glacier.
Being a beginner at skill rank 0, I am also not following. What the hell is a href? What is the difference between script and body? What the difference text and script? I need a tutorial that assumes I know complete zero about this..which is exactly what is going on.
I feel like I’ve missed a tutorial.. at first it was super simple and now he’s speaking spanish..
Fast forward to 4:18 if you came here to learn about functions.
How did he get his webpage? How to I get to the point he is at, at the start of the video? I have no idea how to get that console he is typing into
function add(x,y)
{
return x+y;
}
function Subtract(x,y)
{
return x-y;
}
function Multiply(x,y)
{
return x*y;
}
function Divide(x,y)
{
return x/y;
}
var a=prompt(‘Enter First Number:’);
var b=prompt(‘Enter Second Number:’);
var input=prompt(‘Enter 1 to AddnEnter 2 to SubtractnEnter 3 To MultiplynEnter 4 To Divide’)
if(input==1)
{
alert(add(a,b));
}
else if(input==2)
{
alert(Subtract(a,b));
}
else if(input==3)
{
alert(Multiply(a,b));
}
else if(input==4)
{
alert(Divide(a,b));
}
the prompt in google chrome gives answer for add function as a string e.g
if i enter 1 and 2 as first and second number, it gives 12 instead of 3….
Please Help SomeBody!
Did I miss a lesson between #2 and #1? I felt like I was kicking *$&# after the second lesson. I am so incredibly lost on this, I can’t even begin the lesson. Where is the explanation on how to sync the web and sublime? There needs to be a lesson to explain this lesson. How does one get the web and sublime to work together? What is CSS and HTML? Why are we talking about them? I greatly appreciate the tutorials. As a true beginner, this lesson was unusable. The first two were great.
Similar to python def Function
videos should flow from one to the next – the first one was good. then you lost it with #2 –
Jquery.
Its a shame , you were good
OKay…What the hell is an Index Study HTNMl file?! I was so confused with href and other whatthejigits..that I totally missed him mentioning the file. Where do I find? What do I click? How is this helpful? if i can’t freakin practise?
Terrific video (just like all your others)! Amazing how you make technical concepts accessible to learners of modest competency like me. Your suggestion to practice on our own is *such* good advice.
no sense….I think you fly through it too fast….maybe that’s why
sorry man u lost a viewer this is confusing me and im only like 2 minuites into the vid, i dont understadn what happend when u whent from console to whatever ur using now
I have a couple of years of programming in python for data analysis and machine learning, so programming concepts such as functions, recursion and OOP are familiar to me.
However, when I started to learn about web development, I was quickly overwhelmed by all different technologies that are used to make even a simple website: HTML, CSS, JS, jQuery, Ajax, Flask, Bootstrap and so on. I am not even talking about the server side such as ways to configure them and use with databases. So far I understand what are HTML, CSS. I kind of understand that JS is yet another programming language after watching this video but it is not yet clear how to make it interact with elements on the webpage and why it is so useful in web development.
P.S. I really like the style of teaching of this Youtube channel. Thank you for providing an opportunity to learn!
I didnt know we needed to know html and css to learn this. Now have to go back and learn that.
the program is Sublime Text
great teaching, nice voice and etc.
wooo i did a js function
function fib(){
var seq = [0,1]
for (i = 0; i < 10; i++){ seq[seq.length] = seq[i] + seq[i+1]; } return seq; } console.log(fib());
Need to know the basic before watching this video. The video is clear and simple that to understand a little further basics. Thank you for sharing.
If you want live preview you can use a program called Brackets. I use it and it’s awesome 🙂
lmao people pls go learn css and html before coming here. on their website u have to learn html and css first to learn java hence this vid assume u guys know about css and html i think lol
it’s similar to other computer programs especially c and c++
Can you share your files on the Sublime Text please?
I want to get into coding but i don’t know how to set everything up, what program do you need to type in the code (i’m referring to the window on the left), how did he link the window on the right to google chrome? I don’t get it
I know another programming language, and this is basically the same thing. There a few differences, but nothing huge! This should be a walk in the park for now.