COURSES
MBAData Science & AnalyticsDoctorate Software & Tech AI | ML MarketingManagement
Professional Certificate Programme in HR Management and AnalyticsPost Graduate Certificate in Product ManagementExecutive Post Graduate Program in Healthcare ManagementExecutive PG Programme in Human Resource ManagementMBA in International Finance (integrated with ACCA, UK)Global Master Certificate in Integrated Supply Chain ManagementAdvanced General Management ProgramManagement EssentialsLeadership and Management in New Age BusinessProduct Management Online Certificate ProgramStrategic Human Resources Leadership Cornell Certificate ProgramHuman Resources Management Certificate Program for Indian ExecutivesGlobal Professional Certificate in Effective Leadership and ManagementCSM® Certification TrainingCSPO® Certification TrainingLeading SAFe® 5.1 Training (SAFe® Agilist Certification)SAFe® 5.1 POPM CertificationSAFe® 5.1 Scrum Master Certification (SSM)Implementing SAFe® 5.1 with SPC CertificationSAFe® 5 Release Train Engineer (RTE) CertificationPMP® Certification TrainingPRINCE2® Foundation and Practitioner Certification
Law
Job Linked
Bootcamps
Study Abroad
MS in Data AnalyticsMS in Project ManagementMS in Information TechnologyMasters Degree in Data Analytics and VisualizationMasters Degree in Artificial IntelligenceMBS in Entrepreneurship and MarketingMSc in Data AnalyticsMS in Data AnalyticsMS in Computer ScienceMaster of Science in Business AnalyticsMaster of Business Administration MS in Data ScienceMS in Information TechnologyMaster of Business AdministrationMS in Applied Data ScienceMaster of Business Administration | STEMMS in Data AnalyticsM.Sc. Data Science (60 ECTS)Master of Business AdministrationMS in Information Technology and Administrative Management MS in Computer Science Master of Business Administration MBA General Management-90 ECTSMSc International Business ManagementMS Data Science Master of Business Administration MSc Business Intelligence and Data ScienceMS Data Analytics MS in Management Information SystemsMSc International Business and ManagementMS Engineering ManagementMS in Machine Learning EngineeringMS in Engineering ManagementMSc Data EngineeringMSc Artificial Intelligence EngineeringMPS in InformaticsMPS in Applied Machine IntelligenceMS in Project ManagementMPS in AnalyticsMS in Project ManagementMS in Organizational LeadershipMPS in Analytics - NEU CanadaMBA with specializationMPS in Informatics - NEU Canada Master in Business AdministrationMS in Digital Marketing and MediaMSc Sustainable Tourism and Event ManagementMSc in Circular Economy and Sustainable InnovationMSc in Impact Finance and Fintech ManagementMS Computer ScienceMS in Applied StatisticsMaster in Computer Information SystemsMBA in Technology, Innovation and EntrepreneurshipMSc Data Science with Work PlacementMSc Global Business Management with Work Placement MBA with Work PlacementMS in Robotics and Autonomous SystemsMS in Civil EngineeringMS in Internet of ThingsMSc International Logistics and Supply Chain ManagementMBA- Business InformaticsMSc International ManagementMBA in Strategic Data Driven ManagementMSc Digital MarketingMBA Business and MarketingMaster of Business AdministrationMSc in Sustainable Global Supply Chain ManagementMSc Digital Business Analytics MSc in International HospitalityMSc Luxury and Innovation ManagementMaster of Business Administration-International Business ManagementMS in Computer EngineeringMS in Industrial and Systems EngineeringMSc International Business ManagementMaster in ManagementMSc MarketingMSc Business ManagementMSc Global Supply Chain ManagementMS in Information Systems and Technology with Business Intelligence and Analytics ConcentrationMSc Corporate FinanceMSc Data Analytics for BusinessMaster of Business AdministrationMaster of Business AdministrationMaster of Business AdministrationMSc in International FinanceMSc in International Management and Global LeadershipMaster of Business AdministrationBachelor of BusinessMaster of Business Administration 60 ECTSMaster of Business Administration 90 ECTSMaster of Business Administration 90 ECTSBachelor of Business AnalyticsBachelor of Information TechnologyMaster of Business AdministrationMBA Business AnalyticsMSc in Marketing Analytics and Data IntelligenceMS Biotechnology Management and EntrepreneurshipMSc in Luxury and Fashion ManagementMaster of Business Administration (90 ECTS)Bachelor of Business Administration (180 ECTS)B.Sc. Computer Science (180 ECTS) MSc in International Corporate Finance MSc in Sustainable Luxury and Creative IndustriesMSc Digital Marketing
For College Students

How to Start Coding in Javascript - Overview

$$/$$

When you write some code, it does not start performing its required action then and there. The code performs its action when it is run or executed. You might be wondering where will you be running this JavaScript code. Let's find out the answer to this.

 

You've learned that JavaScript is the language of the web. Well if that’s the case, the browser (be it Mozilla Firefox, Google Chrome, Safari, Internet Explorer or any other) which we use to browse the web,  must surely know how to run JavaScript, isn't it? If you are also thinking the same, then you are on the correct path. Browsers are the ones which execute the JavaScript code.

 

How do browsers execute JavaScript?

Computers understand everything in binary language i.e. in the form of zeroes and ones. Computers do not understand the English alphabets A, B, C, D. Saying “hello” in binary is like saying 01001000 011 and followed by a dozen zeroes and ones. This is the language computers understand. So any instruction you give has to be first converted to binary form and only then the computer can understand and process the instructions. Now it is very tough for the humans to give instructions in the form of 0s and 1s. This is where the programming languages like JavaScript come into the picture. We give instructions to the computer in these programming languages (which are quite understandable by us) and they are converted to the machine language (which is quite understandable by computer) by something called translators.

 

There are different types of translators and we will discuss only two of them - compilers and interpreters.

 

An interpreter processes each line in the program one by one and if an error is encountered on any line, it is reported then and there. On the other hand, a compiler processes the entire program at once and at the end, it reports all the errors (if any) in the entire program.

Please note that JavaScript is interpreted and not compiled. However, there are compilers too available for JavaScript.

$$/$$

Now you might be wondering how to move forward with that, well we’ll start by having you build your own first web page so that you can see how you can use JavaScript on this web page.

To start building your first web page, you first need to build the skeleton of your web page - something that you will be able to see on the web page.  And you require HTML for that.

 

So let’s start by writing some code for it. But first, why don’t you create a new folder so that all your code can stay there? You can name this folder whatever you want and you can create this at any place you want to.

(I have created a new folder with the name 'Sample HTML Code' on Desktop.)

 

So have you created a new folder? Good. Now, let's open this new folder in VSCode by clicking on File menu and then clicking on the Open (macOS) or Open Folder (Windows).

 

 

Or you can also directly click on the 'Open Folder' button as shown in the screenshot below.

 

 

After opening this folder, the view must have changed something similar to this, which shows the name of the opened folder on the left panel. You can see SAMPLE HTML CODE (folder name) in the screenshot given below:

 

 

Now create a new file by clicking on the 'New File' icon, as shown in the screenshot given below:

 

 

Now name this file as index.html. This file will automatically be opened in the editor and the editor will look like this:

 

 

Now copy the code given below and paste it inside the index.html  file and save this file using the shortcut Ctrl + S (Windows) and Cmd + S (macOS). 

 

<!DOCTYPE html>
<head>
   <title>Basic JavaScript</title>
</head>
<body>
    <h2>Learning Basic JavaScript</h2>
    <script>
	// all JavaScript code resides here
    </script>
</body>
</html>

So, here we are with the sample code. Let’s try to understand what is contained inside this code. 

 

 

The <title> tag inside <head> tags is responsible for the title of the webpage. The <body> tag shows the actual content of the webpage as you can see in the image given above. The heading 'Learning Basic JavaScript' comes from the <h2> tag inside <body> tags.

 

Please note that this is just to make you understand the code setup which we are using in the upcoming segments so that you don't feel surprised when you look at it. It is not at all required of you to understand and learn HTML or CSS written in this code. Our only aim is to learn JavaScript in next few sessions and not HTML and CSS.

 

Now you might be wondering what the <script> tag is for! Don’t worry. We will cover this in the next segment.