1 00:00:00,690 --> 00:00:02,040 Hello and welcome. 2 00:00:02,040 --> 00:00:13,260 In this video I'm going to introduce you to what executing a program means in programming to execute 3 00:00:13,350 --> 00:00:20,940 or executing a program basically means getting the program to take some kind of action. 4 00:00:21,570 --> 00:00:28,890 So often you hear developers or programmers using the word execute or executing or they're basically 5 00:00:28,890 --> 00:00:33,610 mean is that they get in the computer or the program to do so. 6 00:00:33,750 --> 00:00:37,260 Another word you may hear is run. 7 00:00:37,380 --> 00:00:45,690 So executing and running a program is basically the same thing to execute the program you tell in the 8 00:00:45,690 --> 00:00:52,640 computer to run or get the program to take some kind of action. 9 00:00:52,740 --> 00:01:01,680 The programs can be executed in various types of environments and also in different ways. 10 00:01:01,680 --> 00:01:10,470 For example if you have a bunch of code in the developer console you can execute a statement or several 11 00:01:10,470 --> 00:01:18,450 statements inside the developer console so dependent on the environment you want to execute your code. 12 00:01:18,480 --> 00:01:21,690 There are different ways you can do that. 13 00:01:21,750 --> 00:01:32,850 I have called three complete javascript statements displayed inside the developer console to get. 14 00:01:32,850 --> 00:01:42,930 For example if I wanted to get value for the third statement which is a variable add numbers if I wanted 15 00:01:42,930 --> 00:01:52,560 to get the computer to compute that value and displayed there are a couple of ways I can go ahead to 16 00:01:52,650 --> 00:01:59,100 execute or run the statement in order to get the desired output. 17 00:01:59,220 --> 00:02:05,520 I want output basically is what the computer gives back to you. 18 00:02:06,300 --> 00:02:06,740 All right. 19 00:02:06,750 --> 00:02:18,870 So for this statement if I want to get an output I want the computer or the program to compute the value 20 00:02:18,930 --> 00:02:22,020 here first number plus second number. 21 00:02:22,170 --> 00:02:26,820 And I want it to display it in a pop up window. 22 00:02:26,870 --> 00:02:31,160 Now a pop up box is something you may have come across before. 23 00:02:31,380 --> 00:02:37,430 It's usually used to display different types of messages and to do that. 24 00:02:37,440 --> 00:02:40,770 We use an alert function. 25 00:02:40,770 --> 00:02:44,190 An alert is a built in function in javascript. 26 00:02:44,190 --> 00:02:50,250 A function is basically a bunch of code that does something specific. 27 00:02:50,250 --> 00:02:57,310 The purpose of an alert function is to display messages in a pop up box. 28 00:02:57,840 --> 00:03:07,890 So in order to execute the statement on line 3 which is this ad number I'm going to use a alert function 29 00:03:07,920 --> 00:03:09,580 which is a pop up box. 30 00:03:09,870 --> 00:03:11,650 So I type in alert. 31 00:03:11,880 --> 00:03:13,410 He has to be in lowercase. 32 00:03:14,490 --> 00:03:21,320 And then in parentheses I need to add what I want to pop up. 33 00:03:22,080 --> 00:03:22,640 OK. 34 00:03:22,650 --> 00:03:28,400 So I want this variable called add numbers. 35 00:03:28,410 --> 00:03:32,700 That's the code I'm trying to execute. 36 00:03:32,700 --> 00:03:33,490 All right. 37 00:03:33,510 --> 00:03:34,990 And I put a semicolon. 38 00:03:35,370 --> 00:03:44,230 So what that would do it will add the first number which is 27 plus the second number which is forty 39 00:03:44,230 --> 00:03:45,200 seven. 40 00:03:45,210 --> 00:03:52,020 So it will add these two variables together and display the results in a pop up box. 41 00:03:52,250 --> 00:03:58,650 Alert is a built in function in javascript that pops up messages. 42 00:03:58,650 --> 00:04:05,370 So the message I wanted to pop up is this one here is this variable and this variable equals to this 43 00:04:05,700 --> 00:04:12,720 variable plus that variable so five PRESENTER As you get a pop up box you can see here is displayed 44 00:04:13,020 --> 00:04:20,120 the output here which is seven to force we've seen four had this plus this. 45 00:04:20,280 --> 00:04:21,900 It will give me that. 46 00:04:22,410 --> 00:04:26,910 So this is known as an alert pop up box. 47 00:04:27,030 --> 00:04:37,170 So the output now executed this statement in an alert box I just click OK and the message will go away. 48 00:04:37,710 --> 00:04:43,470 Now I can also execute the same statement in a different way. 49 00:04:44,250 --> 00:04:48,640 I want 5 1 the result to display inside this console. 50 00:04:48,730 --> 00:04:53,430 I will use another function which is called the console log. 51 00:04:54,090 --> 00:05:01,500 So I just typing basically what the consular log means it will display the output inside the console. 52 00:05:01,510 --> 00:05:13,240 So let me to the same pin do a console and in parentheses add what I want the console to display which 53 00:05:13,240 --> 00:05:15,860 is the variable called add numbers. 54 00:05:16,270 --> 00:05:20,790 So B console dot lock. 55 00:05:21,660 --> 00:05:35,130 OK so you type P console log and inside parentheses you have to had the semicolon and then you press 56 00:05:35,190 --> 00:05:36,040 enter. 57 00:05:36,210 --> 00:05:41,380 You can see here the console dot log which is a function I have passed in. 58 00:05:41,380 --> 00:05:47,880 I've given it the information I want to be displayed and the information I want is this variable here 59 00:05:47,880 --> 00:05:54,880 called add numbers so you can see here is displayed it the output inside the console output. 60 00:05:54,900 --> 00:05:59,310 Basically is the result that the program gives back. 61 00:05:59,310 --> 00:06:01,680 So it's been displayed in the console. 62 00:06:01,680 --> 00:06:06,940 So these are some basic examples of executing programs. 63 00:06:06,930 --> 00:06:14,340 So when you hear the term executing or to execute is the same thing as running a program or to run a 64 00:06:14,340 --> 00:06:22,890 program it means you get in the computer all the program to take some plan of action to display some 65 00:06:23,160 --> 00:06:23,810 output. 66 00:06:24,360 --> 00:06:26,190 So that's it for this video. 67 00:06:26,190 --> 00:06:27,090 Thanks for watching. 68 00:06:27,270 --> 00:06:27,950 Bye for now.