Module 5: Getting Started with JavaScript Flashcards

1
Q

It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages.

A

JavaScript

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

It is an interpreted programming language with object-oriented capabilities.

A

JavaScript

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

It is complimentary to and integrated with Java.

A

JavaScript

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

TRUE OR FALSE:
“JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform.”

A

TRUE

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

Is JavaScript a dynamic computer programming language?

A

Yes

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

JavaScript was first known as?

A

LiveScript

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

Why learn JavaScript?

A
  • Most popular programming language in the world
  • It is everywhere, comes installed on every modern web browser
  • Helps you create really beautiful and crazy fast websites
  • Its usage has now extended to mobile app development
  • Tons of job growth and high pay for those who know JavaScript
  • You can find tons of frameworks and libraries already developed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Applications of JavaScript Programming

A
  • Client-side validation
  • Manipulating HTML Pages
  • User Notifications
  • Back-end Data Loading
  • Presentations
  • Server Applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

This is really important to verify any user input before submitting it to the server and Javascript plays an important role in validting those inputs at front-end itself.

A

Client-side validation

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

This helps in adding and deleting any HTML tag very easily using javascript and modify your HTML to change its look and feel based on different devices and requirements.

A

Manipulating HTML Pages

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

You can use Javascript to raise dynamic pop-ups on the webpages to give different types of notifications to your website visitors.

A

User Notifications

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

Javascript provides Ajax library which helps in loading back-end data while you are doing some other processing. This really gives an amazing experience to your website visitors.

A

Back-end Data Loading

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

JavaScript also provides the facility of creating presentations which gives website look and feel. JavaScript provides RevealJS and BespokeJS libraries to build a web-based slide presentations.

A

Presentations

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

Node JS is built on Chrome’s Javascript runtime for building fast and scalable network applications. This is an event based library which helps in developing very sophisticated server applications including Web Servers.

A

Server Applications

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

the most common form of the language. The script should be included in or referenced by an HTML document for the code to be interpreted by the browser.

A

Client-side JavaScript

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

The JavaScript code is executed when the user submits the form, and only if all the entries are valid, they would be submitted to the Web Server.

A

Client-Side JavaScript

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

Can JavaScript be used to trap user-initiated events such as button clicks, link navigation, and other actions that the user initiates explicitly or implicitly?

A

Yes

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

Advantages of JavaScript

A
  • Less server interaction
  • Immediate feedback to the visitors
  • Increased interactivity
  • Richer interfaces
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server.

A

Less server interaction

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

They don’t have to wait for a page reload to see if they have forgotten to enter something.

A

Immediate feedback to the visitors

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

You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard.

A

Increased interactivity

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

You can use JavaScript to include such items as drag-and-drop components and sliders to give a Rich Interface to your site visitors.

A

Richer interfaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
  • Client-side JavaScript does not allow the reading or writing of files. This has been kept for security reason.
  • JavaScript cannot be used for networking applications because there is no such support available.
  • JavaScript doesn’t have any multi-threading or multiprocessor capabilities.
A

Limitations of JavaScript

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

Javascript can be implemented within what HTML tags?

A
<script>
tags
</script>
25
Q

2 important attributes of script tag

A
  • Language
  • Type
26
Q

This attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.

A

Language

27
Q

This attribute is what is now recommended to indicate the scripting language in use and its value should be set to “text/javascript”.

A

Type

28
Q

Does JavaScript ignore spaces, tabs, and newlines?

A

Yes

29
Q

Semicolons in JavaScript are…

A

Optional

30
Q

JavaScript is a ______________ language. This means that the language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.

A

case-sensitive

31
Q

Single line comment JavaScript

A

//

32
Q

Multi-line comment in JavaScript

A

/* */

33
Q

f you want to have a script run on some event, such as when a user clicks somewhere, where should you place the script?

A

In the <head> tags

34
Q

If you need a script to run as the page loads so that the script generates content in the page, where should the script go?

A

In <body> portion of the document

35
Q

Can JavaScript be kept in an external file?

A

Yes

36
Q

These are the type of values that can be represented and manipulated in a programming language.

A

JS Datatypes

37
Q

3 primitive data types JS

A
  1. Numbers
  2. Strings of text
  3. Boolean
38
Q

2 trivial JS datatypes

A
  • null
  • undefined
39
Q

TRUE OR FALSE:
“JavaScript does not make a distinction between integer values and floating-point values. All numbers in JavaScript are represented as floating-point values.”

A

TRUE

40
Q

can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.

A

JS Variables

41
Q

used for declaration/initialization of variables

A

var keyword

42
Q

has global scope which means it can be defined anywhere in your JavaScript code.

A

Global Variables

43
Q

Variable that will be visible only within a function where it is defined. Function parameters are always local to that function.

A

Local Variables

44
Q

Do’s and don’ts in JS Variable names?

A
  • should not start with a numeral (0-9).
  • must begin with a letter or an underscore character. (Ex. 123test is an invalid variable name but _123test is a valid one.)
  • case-sensitive
45
Q

JS Operators

A
  • Arithmetic Operators
  • Comparison Operators
  • Logical (or Relational) Operators
  • Assignment Operators
  • Conditional (or ternary) Operators
46
Q

Arithmetic Operators

A
  • +
  • -
  • *
  • /
  • %
  • ++
47
Q

Comparison Operators

A
  • ==
  • !=
  • >
  • <
  • > =
  • <=
48
Q

Logical Operators

A
  • &&
  • ||
  • !
49
Q

a unary operator that is placed before its single operand, which can be of any type. Its value is a string indicating the data type of the operand.

A

typeof Operator

50
Q

evaluates to “number”, “string”, or “boolean” if its operand is a number, string, or boolean value and returns true or false based on the evaluation.

A

The typeof operator

51
Q

While writing a program, there may be a situation when you need to adopt one out of a given set of paths. In such cases, you need to use conditional statements that allow your program to make correct decisions and perform right actions.

A

JS If-else Statement

52
Q

To invoke a function somewhere later in the script, you would simply need to write the name of that function

A

Calling a Function

53
Q

a value that is passed when declaring a function.

A

Parameter

54
Q

Can a function be declared with parameters?

A

Yes

55
Q

can be used to return the value to a function call.

A

return statement

56
Q

denotes that the function has ended. Any code after return is not executed.

A

return statement

57
Q

if nothing is returned, the function returns an?

A

Undefined value

58
Q
A