Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Javascript basic information English, Cheat Sheet of Computer Science

An introduction to JavaScript, including its definition, uses, and differences from ECMAScript. It also covers the basics of writing JavaScript code, including the use of code editors and live servers. the concept of statements and variables in JavaScript, as well as best practices for declaring them. It also discusses the dynamic nature of JavaScript and the different types of numbers in the language.

Typology: Cheat Sheet

2022/2023

Available from 04/25/2023

sanjeevan-ev
sanjeevan-ev 🇮🇳

1 document

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Javascript basic information English and more Cheat Sheet Computer Science in PDF only on Docsity! JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour What is JavaScript, what can you do with it, where does JavaScript code run and what is the dierence between JavaScript and ECMAScript. The average salary of a JavaScript developer in the United States is $ 72,000 a year. Every browser has a JavaScript engine and we can easily write JavaScript code here without any additional tools of course this is not how we build real-world applications but this is just for a quick demo. In order to write javascript code you need a code editor there are various code editors out there including Visual Studio code or yes code sublime text atom. Live server is a lightweight web server that we 're going to use to serve our web application so install this then you will have to restart Visual Studio code when you 're done go to the Explorer tab right click index. html and select open with live server. This will open up Chrome or your default browser and point it to this address that's where web application is served from now. JavaScript is a statement a statement is a piece of code that expresses an action to be carried out in this case we want to log a message on the console. All statements in JavaScript should be terminated by a semicolon. In JavaScript we can add some description to our code and this description is ignored by the JavaScript engine. In this lecture I 'm assuming that you have installed node on your machine if not head over to node. js org and download the latest version of node. combine these files into a bundle and serve that bundle to the client. Save the changes back in the browser you can still see the hello world message and that confirms that our code is still working. A variable is one of the most fundamental concepts in JavaScript and any other programming languages in programming. We use a variable to store data temporarily in a computer 's memory. We store our data somewhere and give that memory location and name and with this name we can read the data at the given location in the future. The best practice is to use the lead keyword to declare a variable. The modern best practice is to declare each variable on a single line so we terminate this first declaration with a semicolon and declare the second variable on new line that 's the modern best best practice next we 're going to look at constants alright now let 's declare a variable called interest rate so let interest rate and we set this to 0. 3 now this is the initial value. The best practice is to use a constant so the value of a variable as the name implies can change but a constant can not change so here if we change let to Const now interest rate will be a constant. In situations where we want to have some logic for example if the order is approved then it needs to be shipped. JavaScript is a dynamic language so unlike other programming languages the type of these variables will be determined at runtime based on the values that we assigned to them. In JavaScript unlike other languages we don't have two kinds of numbers we do n't have floating-point numbers and integers. In es6 we have another primitive that is symbol and you 're going to learn about that later in the course.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved