MY JOURNEY LEARNING JAVASCRIPT (WEEK 1: Javascript Fundamentals Part 1)

Minolta Ndlovu
3 min readFeb 9, 2021

Hi! My name is Minolta Ndlovu, I am a sophomore at Bryn Mawr College studying Computer Science. I recently started learning Javascript, I am taking a course on Udemy, a very helpful learning platform for almost anything you want to learn under the sun. I will be documenting some of the concepts from the course here on medium every week. Hopefully, I can help someone else learn how to write JS code or fix a bug in their code or help refresh their memory on a concept. Either way, let’s learn together!

Photo by Irvan Smith on Unsplash

What is Javascript?

So, what is Javascript? Javascript is a high-level, object-oriented, multi-paradigm programming language. I will break the definition down for you below and give the meaning of each language description.

* High-level: No memory management, closer to human languages and more readable
* Object-oriented: Based on objects for data storage
* Multi-paradigm: Flexible, we can use different styles of programming

Javascript is commonly used in web development and its role is to manipulate HTML and CSS to produce dynamic effects on web apps and make them interactive. Basically, it gives web apps life! Cool, right? As a front-end developer, this is a must-know programming language.

Values and Variables

Like all programming languages, Javascript has a means of data storage using values and variables. A value is the piece of data and a variable is a container that stores this data. Values are stored in variables for re-use. The way that you store this data is by “declaring a variable”. For example:let firstName = 'Minnie';is a declaration statement that stores the value, Minnie to a variable, firstName. The declaration statement is divided into two parts:

  1. Defining the variable : let firstName; Instead of let , you can also use the keyword const to define a variable like this: const firstName . We use const to define a variable that cannot be reassigned a value and let to define variables whose values can be changed or reassigned.
  2. Assigning a value to the variable : let firstName = 'Minnie'; . We use the = sign to assign values to variables.

Another keyword you might come across is var . Try by all means to avoid using varto define variables. It’s now outdated.

Data Types

Javascript variables hold different data types. In the above example, my name ‘Minnie’ is a text, formally know as a String data type. Data types are really important in programming languages, to be able to operate on a variable a computer needs to know its data type. In Javascript, these are divided into two categories, primitive data types, and objects. In this article, I will focus on the former. A primitive data value is a single data value with no other properties or methods. Javascript has seven of these which are:

  1. Numbers — numbers can be written with or without decimals
  2. Strings— a sequence of characters, written in quotes, for example 'Minnie' . Both double and single quotes work just fine!
  3. Boolean — logical type that can only be true or false
  4. Undefined — variable declared with no value, for example let car;
  5. Null — empty value. Take note: Undefined and Null are equal in value but different in type.
  6. Bigint
  7. Symbol

Data types mark the end of this article! Thank you for getting this far, I hope this information was helpful.

--

--