JAVASCRIPT Flashcards

1
Q

a light-weight object-oriented programming language which is used by several websites for scripting the webpages.

A

JavaScript

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

It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied to an HTML document.

A

JavaScript

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

JavaScript was introduced in the year _____- for adding programs to the webpages in the Netscape Navigator browser.

A

1995

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

What are the features of JavaScript?

A
  1. All popular web browsers support JavaScript as they provide built-in execution environments.
  2. JavaScript follows the syntax and structure of the C programming language. Thus, it is a structured programming language.
  3. JavaScript is a weakly typed language, where certain types are implicitly cast (depending on the operation).
  4. JavaScript is an object-oriented programming language that uses prototypes rather than using classes for inheritance.
  5. It is a light-weighted and interpreted language.
  6. It is a case-sensitive language.
  7. JavaScript is supportable in several operating systems including, Windows, macOS, etc.
  8. It provides good control to the users over the web browsers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

the first popular web browser in 1993

A

Mosaic

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

In the year 1994, Netscape was founded by?

A

Marc Andreessen

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

in 1995 who implement and embed Scheme programming language to the browser?

A

Brendan Eich

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

JavaScript is used to create interactive websites. It is mainly used for?

A

Client-side validation,

Dynamic drop-down menus,

Displaying date and time,

Displaying pop-up windows and dialog boxes (like an alert dialog box, confirm dialog box and prompt dialog box),

Displaying clocks etc.

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

The ________ tag specifies that we are using JavaScript.

A

script

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

The _____________ is the content type that provides information to the browser about the data.

A

text/javascript

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

The _______________ function is used to display dynamic content through JavaScript.

A

document.write()

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

What are the 3 Places to put JavaScript code?

A

Between the body tag of html

Between the head tag of html

In .js file (external javaScript)

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

What is the output of this code?

<html>
<head>

<script>
function msg(){  
 alert("Hello Javatpoint");  
}
</script>

</head>
<body>
<p>Welcome to JavaScript</p>
<form>
<input></input>
</form>
</body>
</html>
A

Welcome to Javascript

yna -> a button

and when you click “yna”

it will show “Hello Javatpoint” which is the message

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

True or False

We can create external JavaScript file and embed it in many html page.

A

True

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

True or False

External JavaScript file provides code re usability because single JavaScript file can be used in several html pages.

A

True

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

What are the advantages of external JavaScript?

A
  • It helps in the reusability of code in more than one HTML file.
  • It allows easy code readability.
  • It is time-efficient as web browsers cache the external js files, which further reduces the page loading time.
  • It enables both web designers and coders to work with html and js files parallelly and separately, i.e., without facing any code conflictions.
  • The length of the code reduces as only we need to specify the location of the js file.
17
Q

What are the disadvantages of external JavaScript?

A

The stealer may download the coder’s code using the url of the js file.

If two js files are dependent on one another, then a failure in one file may affect the execution of the other dependent file.

The web browser needs to make an additional http request to get the js code.

A tiny to a large change in the js code may cause unexpected results in all its dependent files.

We need to check each file that depends on the commonly created external javascript file.

If it is a few lines of code, then better to implement the internal javascript code.

18
Q

meaningful way to deliver message. It is used to add information about the code, warnings or suggestions so that end user can easily interpret the code.

A

JavaScript comments

19
Q

two advantages of JavaScript comments?

A
  • To make code easy to understand
  • To avoid the unnecessary code
20
Q

a name of storage location.

A

JavaScript variable

21
Q

two types of variables in JavaScript ?

A

local variable and global variable.

22
Q

declared inside block or function. It is accessible within the function or block only

A

JavaScript local variable

23
Q

accessible from any function. A variable i.e. declared outside the function or declared with window object

A

JavaScript global variable

24
Q

two types of data types in JavaScript.

A
  • Primitive data type
  • Non-primitive (reference) data type
25
Q

JavaScript is a______ ________ language

A

dynamic type

26
Q

You need to use_____ here to specify the data type.

A

var

27
Q

What are the primitive data types in JavaScript?

A
  • String
  • Number
  • Boolean
  • Undefined
  • null
28
Q

What are the non - primititive data type in JavaScript?

A
  • Objects
  • Array
  • RegExp
29
Q

represents instance through which we can access members

A

Objects

30
Q

represents group of similar values

A

Array

31
Q

represents regular expression

A

RegExp

32
Q

types of operators in JavaScript.

A

Arithmetic Operators

Comparison (Relational) Operators

Bitwise Operators

Logical Operators

Assignment Operators

Special Operators

33
Q
A