Questions tagged as 'javascript'

1
answer

How do prototypes work in JavaScript?

It seems to me that the concept of prototype is fundamental in JavaScript and even in several places I have read that it is one of its strengths. However, this does not seem like a simple concept to understand for those who come from other langu...
asked by 08.05.2014 / 22:02
5
answers

How to print content inside an HTML div?

I have a page and in it the content I want to print. I created a command in JavaScript, but this command makes the whole page print. Is there any way to print only the contents of a div ?     
asked by 21.12.2013 / 04:20
2
answers

Javascript interpreted or compiled at runtime?

In this other question I asked the same thing, but in relation to Java. Now I ask about Javascript. As far as I know, Javascript historically has always been interpreted, but Google has changed that with V8 on Chromium. Am I right or wrong?...
asked by 22.07.2014 / 13:26
6
answers

Is there a JavaScript class?

I'm studying JavaScript and saw some explanations that left me with doubts. Here in StackOverflow I saw several questions about whether to create an abstract class in JavaScript. But my question is: Is it possible to create a class in JavaSc...
asked by 15.01.2016 / 17:55
1
answer

Why (! + [] + [] +! []). length returns 9 in JavaScript?

I just read this article and there is this expression: (!+[]+[]+![]).length Evaluating this in the interpreter: > (!+[]+[]+![]).length 9 Well, why?     
asked by 29.08.2014 / 22:36
4
answers

What is the difference between declaring variables using let and var?

Since the word let was introduced in ECMAScript I have only heard about it, so far I have not seen any practical examples and to be honest I do not know very well what a let variable is and how it behaves. The only thing I unders...
asked by 16.01.2015 / 13:56
3
answers

What's the point of using double negation in Javascript?

Recently, while studying some code in javascript, I came across the following code: return !!navigator.userAgent.match(/iPad/i); I know that: !true == false !false == true And consequently: !!true == true !!false == false So I was...
asked by 14.08.2014 / 17:22
2
answers

How to capture a photo via the user's webcam and send via POST?

How to perform the procedure of capturing the user's webcam image in a registration form to send via POST ? I'm looking for a solution that is compatible with most browsers and is simple to implement.     
asked by 05.07.2014 / 19:03
6
answers

How to get unique values in a JavaScript array?

In PHP, when I have array with duplicate values, it is possible to get only single values through the function array_unique . Example: $array = ['a', 'b', 'b', 'c', 'c']; array_unique($array); // ['a', 'b', 'c'] But I neede...
asked by 01.09.2016 / 14:48
4
answers

How can I not allow a character to be typed in the textbox, with javascript / jquery?

I have a Textbox: <input type="text" name="indice" class="number"> I wanted it when someone typed a comma in this Textbox to block it from appearing in Textbox. How to do this in the best way? I would not want it if the person k...
asked by 15.01.2014 / 18:24