Questions tagged as 'javascript'

5
answers

How to get TimeStamp in Javascript?

Would you like to know how to Javascript to get Timestamp ? A number that represents the current date and time. I know we get the object for date and time through: var d = new Date(); But I do not know how to proceed from here....
asked by 17.12.2013 / 17:39
3
answers

What is the definition of verbose code? And why is it interesting to reduce it?

Recently I've heard about verbose code reduction (along with the term boiler plate code ), and also studying ES6 by falling into arrow-functions . Would you like a clearer definition of what verbose code would be? And why is it interesting to...
asked by 23.12.2016 / 12:26
7
answers

Remove elements repeated within a vector in javascript

How do I remove repeated elements within a vector / stack / array in javascript? I have for example: var array = ['foo', 'bar', 'foo']; and I want to remove all duplicates to get: ['foo', 'bar']     
asked by 20.05.2014 / 21:59
3
answers

How to write code as an example, without executing?

I'm doing the translation of a book to an HTML page, there in the book have the codes, but how do I make my HTML display my code, HTML, PHP and JavaScript without running them?     
asked by 24.04.2015 / 15:02
3
answers

What is the difference between the for ... of and the for..in?

I was checking out this SOEN question and there I saw this for..of . I've never seen this before in Javascript . This is a new feature and we can already implement it reliably, or should we still use the old for..in ?...
asked by 02.10.2015 / 17:58
3
answers

How to calculate PI with "n" decimal places in JavaScript?

Using the Math object of JavaScript, I can return a PI value with fixed decimal places, for example: Math.PI //3.141592653589793 But in case I need (yes, quite unusual) to calculate the same with more decimal places, is there any o...
asked by 22.02.2015 / 22:38
2
answers

What is the difference between Javascript and jQuery?

I think of Jquery as a Framework Javascript in order to optimize writing, Ajax is a good example. In addition to facilitating writing, is there a difference between the two? What are the advantages and disadvantages...
asked by 26.04.2017 / 20:28
3
answers

How to check if a variable is defined?

I tried to do it this way: else if (vCodUG === undefined) and gave error of:    Uncaught ReferenceError: vCodUG is not defined     
asked by 05.06.2014 / 16:24
4
answers

What does the regular expression "/ (? = (?: ...) * $) /"?

I just needed a solution to put points to separate numbers from three to three, backwards. For example: 1000 => 1.000 100000 => 100.000 10000000 => 1.000.000 In a response I found in Stackoverflow English , the last solution wa...
asked by 06.02.2017 / 12:01
2
answers

How does JavaScript obfuscation work?

I would like to know how this business "obfuscates" a JavaScript code. For example, there is an online service on a site that "obfuscates" the code on time. Just paste your code and it returns the whole "obfuscated" code: Simple code examp...
asked by 02.11.2017 / 03:19