Questions tagged as 'javascript'

1
answer

Difference between high-order and first-class functions

Functional language, what is the difference between high-order functions and first-class functions in> first-class functins )? In JavaScript, what would be the difference between these two types of functions?     
asked by 02.04.2014 / 14:51
1
answer

List states, cities and neighborhoods in register form [closed]

I have a table called "advertisement", where I need to register the information coming from other 03 tables, they are: State Tables, Cities and Neighborhoods. The purpose is for the user to register the properties via the form, adding info...
asked by 19.11.2015 / 02:13
2
answers

How to hide a visible submenu when clicking another menu in JS?

I have the script below to use in a menu. It changes the visibility of a specific element by its ID. Clicking on a main menu opens a submenu. Is there any way to change the script so that when clicking on another menu the previous submenu clo...
asked by 23.01.2014 / 21:45
1
answer

How to set TitleCase using regex in Javascript?

I have this function: var titleCase = function(s) { return s.replace(/(\w)(\w*)/g, function(g0, g1, g2) { return g1.toUpperCase() + g2.toLowerCase(); }); } If I call her by passing something she works ri...
asked by 28.04.2014 / 19:45
5
answers

Catching piece of text inside a javascript word

I need to check if there is a specific piece within a snippet of a word in javascript. Example, my word is John, I need to check if Jo contains it. I tried to do with indexOf but it did not work, but it did not work. //pesquiso tudo que...
asked by 14.12.2017 / 12:53
1
answer

What is the purpose of Object.is?

I noticed that Javascript now has Object.is and according to the documentation:    Object.is determines whether two values match the same value. About this I had some doubts: Why Object.is , if I can compare the...
asked by 23.10.2018 / 18:56
1
answer

Regular expression and template are not working

I'm trying to create a template engine using JavaScript. The syntax will be more or less similar to that of Laravel (blade), with some modifications. I'm part of creating expressions. The first one I'm doing is if , but right away I've...
asked by 21.03.2018 / 18:00
1
answer

How to create a dynamic progress bar considering all the fields of a form?

I'm trying to create a progress bar a little different from the ones I found out there. This , for example, gets the values of the fields and plays in aria-valuenow of the progress bar. In my case, I want to get the fields that...
asked by 17.12.2015 / 05:00
2
answers

How to determine which HTML element and / or event called a function?

I have a function called by two different HTML elements and each of the elements calls the function through a certain event. $("#tempoInicial").on("blur", manipulaTempoFinal); $("#operadorTempo").on("change", manipulaTempoFinal); function man...
asked by 24.02.2014 / 21:14
1
answer

What is the difference between props and state in React.js?

What is the difference between props and state in react.js , what are the differences and how should they be used?     
asked by 30.12.2016 / 00:36