Javacript Flashcards

All the Essential Concepts on Js.

1
Q

Do you know the rules for naming variables in JavaScript?

A
  1. It can not start with a number
  2. It should begin with a letter, $ sign or _
  3. Do not use -, space, or . on a variable name
  4. Do not use reserved keywords. JS reserved keywords reference (https://www.w3schools.com/js/js_reserved.asp)
  5. Variables are case sensitive
  6. If the variable name uses multiple words capitalizes the first letter of each word except the first one
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Do you know what data structure is?

A

Data structure is a data organization, management, and storage format that enables efficient access and modification.
It is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
It is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Do you know why we need to structure data in the first place?

A

Data structures provide a means to manage large amounts of data efficiently for uses such as large databases and internet indexing services. Usually, efficient data structures are key to designing efficient and faster algorithms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Do you know the types of data structures?

A

Data can be broadly categorized in to two main types named primitive and non-primitive data structures.
Primitive data structures and data types are native or predefined to the programming language. These include Boolean, Number, String, Undefined, Null, Symbol, BigInt
Non-primitive (reference) data structures are not defined by the programming language but rather by the programmer. These include linear data structures (Array, Stack, Queue, Linked List), and non linear data structures (Tree, Graph, Hash table)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Do you know what undeclared and undefined variables are?

A

Undeclared variables - are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.
Undefined variables - are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Do you know what NULL means in Javascript?

A

The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number and no array object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Do you know the most commonly used operators in JavaScript?

A

JavaScript operators are used to assign values, compare values, perform arithmetic operations, and more.
Assignment operator ( = ) - are used to assign or change values to JS variables.
Arithmetic operators ( +, -, *, / ) - are used to perform arithmetic between variables and/or values. It Works in a similar way we use them in math.
String Operator (Concatenation) - The + operator, and the += operator can also be used to concatenate (add or join) strings.
Comparison operators - are used in logical statements to determine equality or difference between variables or values. It always return a boolean value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Do you know the comparison operators?

A

Equal to ( == ) - compares only values.
Strictly Equal to ( === ) - compares value and type of data.
Not Equal to ( != ) - compares only values.
Strictly Not Equal to ( !== ) - compares values and type of data..
Greater than ( > )
Less than ( < )
Greater than or Equal to ( >= )
Less than or Equal to ( <= )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Do you know what a computer programming language is?

A

Do you know what a computer programming language is?
Computer programming language is a way of giving instructions to a computer on what it should do. Programming languages differ from human languages because they have precise syntax and semantics. Human languages are tolerant of imprecise syntax and ambiguous semantics. Human languages are supported by non-verbal communication to enrich and clarify the meaning of the words .
Note: Everything in your computer’s processor and memory works in binary system. Means, every programing language needs to be converted to 0s and 1s for the computer to understand it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Do you know what a binary system is and why computers use this system?

A

Binary is a two-digit (Base-2) numerical system, which computers use to store data and compute functions. The reason computers use the binary system is because the way we store data in our computers is using digital switches inside the computer (transistors) which can only be set to either on or off, which are represented by a 1 or 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Do you know what compilers are?

A

A compiler is a computer program that translates computer code written in one programming language into another language. The name “compiler” is primarily used for programs that translate source code from a high-level programming language (JS, C++, Java, Python) to a lower level language (Binary) to create an executable program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Do you know what scripting languages are?

A

Scripting languages are a specific kind of computer languages that you can use to give instructions to other software, such as a web browser, server, or standalone application.
Scripting languages are interpreted and not compiled. That means the instructions are directly executed without requiring them to be compiled into a machine language program. Whereas Programming languages are first compiled into Machine code then executed.
Every browser has a JavaScript engine that takes our JavaScript code and converts it into something that the browser can understand.
Example: IE has Chakra, Chrome has V8, Firefox has SpiderMonkey, and Safar has JavaScriptCore.
Note: JavaScript is both a programming and scripting language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Do you understand what JavaScript is and why we have to learn it?

A

JavaScript is a scripting or programming language. It was initially created to make web pages alive/interactive, that we use to create interactive effects. In short, it takes your HTML elements and makes them interactive/functional. For Example: To make a user login, when a user clicks on the button element you wrote in your HTML, you will need to use JavaScript codes.
We will need JavaScript if our webpage saves and retrieves data. We use JavaScript language to get data from the database.
JavaScript can update and change both HTML and CSS.
JavaScript can calculate, manipulate and validate data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Do you know what Core JavaScript, Client side and Server side JavaScript are?

A

Core JavaScript - is the basic of the JavaScript language that supports both the client and server side. It is the standard both the developers of the compilers and writers follow.
The client-side JavaScript - is specific instructions that are only understood by the Browsers (i.e DOM) and has core JavaScript elements. For functioning, it also has properties and methods, which helps developers.
Server-side JavaScript - as the name suggests runs on server-side. It is JavaScript instructions that are mainly written to communicate directly with the computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Do you know what syntax and semantics are in JavaScript and the best way to check if they are working correctly?

A

Syntax - is the set of rules, how JavaScript programs are constructed.
Semantics - is the interpretation or meaning of the script you write.
Best practice you should follow when writing a script is to check every single line of code as you write it. Both for syntax and semantics error. That means you need some kind of way to double check your line of code as you write it. You can use console.log() to check using the console on your browser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Do you know how to include JavaScript on your HTML and use the console for debugging?

A

In HTML, JavaScript code is inserted using the script tag
To use the console for debugging - right click on your website you are working on the browser and click on inspect, then click on console.

17
Q

Do you know what variables are and how to declare them?

A

Variable means anything that can vary. JavaScript includes variables which hold the data value and it can be changed anytime.
JavaScript uses reserved keyword var.
let and const are the newer ways of declaring variables are introduced and added in 2016 (ES6).
Creating a variable in JavaScript is called “declaring” a variable
Example: var carName; let width; const height;

18
Q

Do you know how to assign a variable and change the value of the variable?

A

After declaring a variable we can assign it a value using the assignment operator (=). Example var carName = “Tesla”;
To reassign its value we can call the variable name and give it a new value using the assignment operator again. Example, let’s reassign the variable we declared above, carName = “Honda”;
Note: once we declare a variable using let and assign a value we can not re-declare the same variable again in the same scope. However, we can reassign its value.
Note: once we declare a variable using const and assign a value we can neither re-declare nor reassign it to a new value again in the same scope.

19
Q

Do you know the rules for naming variables in JavaScript?

A
  1. It can not start with a number
  2. It should begin with a letter, $ sign or _
  3. Do not use -, space, or . on a variable name
  4. Do not use reserved keywords. JS reserved keywords reference (https://www.w3schools.com/js/js_reserved.asp)
  5. Variables are case sensitive
  6. If the variable name uses multiple words capitalizes the first letter of each word except the first one
20
Q

Do you know what data structure is?

A

Data structure is a data organization, management, and storage format that enables efficient access and modification.
It is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
It is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.

21
Q

Do you know why we need to structure data in the first place?

A

Data structures provide a means to manage large amounts of data efficiently for uses such as large databases and internet indexing services. Usually, efficient data structures are key to designing efficient and faster algorithms.

22
Q

Do you know the types of data structures?

A

Data can be broadly categorized in to two main types named primitive and non-primitive data structures.
Primitive data structures and data types are native or predefined to the programming language. These include Boolean, Number, String, Undefined, Null, Symbol, BigInt
Non-primitive (reference) data structures are not defined by the programming language but rather by the programmer. These include linear data structures (Array, Stack, Queue, Linked List), and non linear data structures (Tree, Graph, Hash table)

23
Q

Do you know what undeclared and undefined variables are?

A

Undeclared variables - are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.
Undefined variables - are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.

24
Q

Do you know what NULL means in Javascript?

A

The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number and no array object.

25
Q

Do you know what variable weak typing is?

A

Variable weak typing is assigning a variable to one data type (number, string, or boolean) and then later on assigning the same variable to another data type.
JavaScript is a weakly (loosely) typed language, meaning you don’t have to specify what type of information will be stored in a variable in advance. Many other languages, like Java, require you to declare a variable’s type, such as int, float, boolean, or String.
Example: var a = 7; a = “Seven”;

26
Q

Do you know what an array is and how to declare an array?

A

An array is a special type of data structure
An array is collection of primitive data type values
Array can be declared just like any variable. The name of the Array is also going to be the variable. The difference is in the value. Array contains multiple values
When you declare empty array you use square brackets to represent arrays
Example: var exampleArray = [];

27
Q
A