Posts by felipe cardozo • 275 points
24 posts
-
6
votes3
answers246
viewsQ: What is the point of using scripts in links?
I recently saw on the website of W3schools the ability to execute Javascript code in links, placing scripts within the attribute href: <a href="javascript:alert('Hello World!');">Execute…
-
8
votes2
answers337
viewsQ: How do "for in, for of, foreach" loops traverse the array?
I’ve always used the loop for in which it differentiates a little from the mentioned loops, but the question is how these loops travel the array as, for example, the loop for usually follows these…
-
-1
votes1
answer52
viewsQ: What is the advantage of using Javascript?
Using label in for let str = ''; loop1: for (let i = 0; i < 5; i ++) { if (i === 1) { continue loop1; } str = str + i; } console.log(str); Not using label on for let str = ''; for (let i = 0; i…
javascriptasked felipe cardozo 275 -
4
votes2
answers279
viewsQ: How does Undefined return work?
When a variable is declared, but it has no value assigned to it, theoretically it has no data, but it exists in memory and is ready to be used: let myVariable; But when trying to use it is the same…
javascriptasked felipe cardozo 275 -
1
votes1
answer50
viewsQ: How do these symbols (text Fragments) work in the "#:~:text=" URL?
I see some sites use these symbols #:~:text= links as a way of highlighting the text or a certain part of the text of the site on which it is relevant. As, for example, below is opened a MDN page…
-
0
votes1
answer20
viewsQ: Elements <td> in a new row when reaching a certain quantity
I have a code in which it aims to generate some elements <td> (cells) in the table and if the row containing the elements <td> achieve a certain amount of elements <td> (in which…
javascriptasked felipe cardozo 275 -
1
votes2
answers280
viewsQ: How to decrease touchpad scroll sensitivity in Vscode?
I’ve literally already searched and found no option in the Vscode to solve this problem in scroll of touchpad, because when you are editing the code and want to go to a certain section and if it is…
visual-studio-codeasked felipe cardozo 275 -
2
votes1
answer199
viewsQ: What is the difference between "value types" and "Reference types"?
I didn’t quite understand these classifications among the types that a variable can contain that are value types (types of value) and Reference types (reference types) that exists in the language…
-
2
votes2
answers332
viewsQ: How to change the color of only the clicked element?
This question is similar to change color only of clicked element the difference is that Jquery is used and I need pure JS, I have some elements <summary> and when I click on the element…
javascriptasked felipe cardozo 275 -
8
votes2
answers146
viewsQ: What is Function.prototype.call() for?
I get confused in using the method call(). It serves to call a function, inherit the parameters of a function or the properties? Another question of mine is in relation to the keyword this passed as…
-
-1
votes1
answer90
viewsQ: Can you create a Bookmark without the id attribute?
Well, I have this doubt because I have read several articles from certain websites and many of the authors do not place the attribute id in the elements what ends up happening is that if you find…
htmlasked felipe cardozo 275 -
1
votes0
answers73
viewsQ: How does the browser traverse the prototype chain with string and array?
To illustrate my question and my question I will use the following simple example: function Car(name, age) { this.name = name; this.age = age; this.phrase = function() { alert(`${this.name}…
javascriptasked felipe cardozo 275 -
1
votes1
answer62
viewsQ: Draw only with the "brush" and just "circles" when you click certain buttons
I’m building a simple program to draw on canvas where you can draw a circle and draw with the brush by clicking on certain buttons Desenhar círculo (by clicking on canvas the circle is drawn) and…
javascriptasked felipe cardozo 275 -
2
votes2
answers273
viewsQ: What is the best way to call the requestAnimationFrame() method?
I’ve seen in several examples on the web mainly on MDN using the following syntax to call the method requestAnimationFrame(): function minhaFuncao() { requestAnimationFrame(minhaFuncao); }…
javascriptasked felipe cardozo 275 -
2
votes0
answers31
viewsQ: Why does the attribute "autofocus" not work, coming from another document?
In order to understand my situation, I am trying to incorporate a document (page) in another document through the element <iframe>. This document I’m trying to embed contains a form that has a…
htmlasked felipe cardozo 275 -
3
votes1
answer64
viewsQ: What are HTML interfaces for?
Every specification (documentation) that I see of a certain HTML element, always specify the element to a type of interface as, for example: HTMLTableCaptionElement HTMLButtonElement HTMLBRElement…
-
3
votes0
answers22
viewsQ: What are Rest parameters?
Recently I discovered that there are Rest parameters in the Javascript which has the following syntax: function (a, b, ...c) { // Code. } But I didn’t understand very well what they are, what they…
javascriptasked felipe cardozo 275 -
-2
votes5
answers691
viewsQ: How to delete a deleted Github repository?
I recently deleted a repository with the name JS and the Github has the option to restore repositories (Settings/Repositories/Deleted repositories) deleted which does not actually delete the…
githubasked felipe cardozo 275 -
5
votes1
answer185
viewsQ: What is the difference between creating an object from the literal form or from a constructor function?
I wonder if it has any difference or relevance between the two forms below in the construction of an object: Create an object from the literal form: let pessoa = { nome: 'Pedro' };…
-
13
votes2
answers1239
viewsQ: How does the localCompare() method work?
The only thing I know about this method is that it compares the strings to see who comes first, after or if they are equal and subsequent has a representative numerical value returned as -1, 1, 0…
javascriptasked felipe cardozo 275 -
4
votes3
answers391
viewsQ: What are literal types in Javascript?
I’ve seen several times the terms in the programming of literal types, but I don’t know what that is, for example, literal string, literal numbers, literal objects and so on. What is that? There’s a…
javascriptasked felipe cardozo 275 -
-3
votes1
answer326
viewsQ: How to remove the dot after the number in the marker?
How I remove these points in the marker that is displayed after the item number from an ordered list: <ol> <li>Lista 1</li> <li>Lista 2</li> <li>Lista…
htmlasked felipe cardozo 275 -
-2
votes1
answer59
viewsQ: Why is error returned if you add a String with a Number?
If I type the following in the terminal of the Python no error is returned and the result is displayed normally. In the terminal: >> 10 + "10" # 20 But if I put in variables and try to add up…
pythonasked felipe cardozo 275 -
0
votes1
answer35
viewsQ: Is the <audio> element part of the "Palpable content" group or not?
I wonder if the element <audio> is part of the group Palpable content, because according to the website WHATWG they mention: If the element has a Controls attribute: Palpable content. That is…
htmlasked felipe cardozo 275