0% found this document useful (0 votes)
2 views3 pages

JavaScript Basics and HTML Structure Guide

The document contains a series of programming questions and answers related to JavaScript, HTML, and general programming concepts. It covers topics such as variable types, console output, function purposes, HTML structure, and DOM. Each question is followed by a concise answer, providing a quick reference for programming knowledge.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

JavaScript Basics and HTML Structure Guide

The document contains a series of programming questions and answers related to JavaScript, HTML, and general programming concepts. It covers topics such as variable types, console output, function purposes, HTML structure, and DOM. Each question is followed by a concise answer, providing a quick reference for programming knowledge.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

For the code:


var a = 10;
var b = "12";
var c = b + a;
What kind of variable is c?
R/ String

2. ¿Cuál es el valor que mostrará el [Link] en el siguiente programa?


var enter = 0;
var altura = 101;
if (height > 100 || height < 50) {
entrar = 1;
}
else if(height > 60 || height < 40){
entrar = 2;
}
[Link](entrar);
R/ 1

3. ¿Qué resultado obtenemos altener z = [Link](4.64);


R/ 5

4. In programming, Backend is:


R/ Who programs the connection with the server and data for the user

5. What purpose does a function serve?


It helps us reuse / encapsulate code snippets that will be used constantly.

6. It is the way in which an external JavaScript file is invoked from our HTML:
R/ <script src = "[Link]"></script>

7. In the following code, what is the result that will be displayed in the console?
var bills = [ [ 1 , 2 , 3 ] ,
[4,5,6]
[ 7 , 8 , 9 ] ];
[Link](bills[1][2])
R/ 6

8. It is the way to execute the function 'move' when the user presses any key:
R/ [Link]("keydown", mover);

9. If we want to declare a variable called message and assign it the text "I already know how to program", I do it
with the option:
R/alert("I already know how to program");

10. Why should we place the <script> tag right before the closing </body>?
R/ Because this way our page will be able to display something before executing the code

11. What does the [Link] function do?


R/Display text in the browser when an action is fulfilled
- help to write directly in our html

12. If you run the following code, what will be displayed in the console?

variable;
if(variable) { [Link]("works");
}
else { [Link]("does not work");
}
It doesn't work
- works
16. If I have the following code

[Link](variable);
function declare() { variable = 12; }
What will be displayed in the console?
R/ - 12
- variable = 12

17. In programming, Frontend is:


R/ Who programs the user interaction

18. Al ejecutar el siguiente código:

var counter = 2;
var na = "na";
while(counter)
{
na += na;
contador -= 1;
}
[Link](na + " Freddy ")

What will be displayed in the console?


R/nanana Freddy

19. If I have the following code


declare(); [Link](variable);
What will be displayed in the console?
R/ -12
- variable = 12

20. In HTML, the tag:


<meta charset="ut-8" />
It is used for:
R/ Make the text compatible with international characters

21. What is HTML used for?


To semantically structure the content of a website

22. What is the DOM?


R/ Document Object Model is the way in which the browser internally organizes everything
HTML within a tree structure

23. What is the basic structure of an HTML5 file?


R/<!DOCTYPE html>
<html>
<head>
<meta charset="ut-8">
<ttle></ttle>
</head>
<body>
</body>
</html>

24. In the following code, what is the value of the variable vida?

function pakiman(life)
{
life = life + life;
life++;
return life;
}
nombre: "Pakiman",
ataque: 101
};
[Link] = [Link] * 2;

How much is [Link]?


R/ 202

27. To examine the HTML of any page with our browser, what is the tool that
do we use?
R/ The Element Inspector (Inspect) or View page source

28. What is the purpose of the 'alert' function in JavaScript and how is it invoked?
R/ Triggers an alert window in the browser, with the message that we configure; it runs
like:
alert(" My Message ");

29. What do we use the prompt function for?


To convert text strings to integers
- To perform mathematical operations

30. What purpose does a function serve?


It helps us to reuse/encapsulate code snippets that will be used constantly.

31. What is the <strong> tag used for?


It makes the text more important by showing it in bold.

32. What is concatenation?


R/ Join 2 or more strings of text

33. When you want to start drawing in HTML, which tag helps us create a canvas?
R/ canvas

34. Here are some rules regarding variable names in JavaScript:


They must start with a letter and cannot have spaces.

35. What is the <p> tag used for?


R/ Define a paragraph in HTML

You might also like