javascript

Why is NaN output and how to fix it?

At the beginning, the value of positive is NaN, then, after positive, bad or neutral is added, NaN changes the value: import ... neutral + bad))*100)}</p> </div> </div> ) } export default App;

Why is NaN not equal to NaN?

console.log( null == null, undefined == undefined, NaN == NaN ); // true, true, false Why?

Is const, let, and var different in terms of performance and memory in js?

I'm studying js, and the question is ripe: does const differ from var and let in terms of performance and memory occupied by variables? The question may seem silly, but I didn't find any information on it.

How do I set an infinite function call via setTimeout?

I have functions for working with a simple slider, I want to make it infinitely rewind, via setTimeout, but I don't know how ... < 0){ num= image.length-1; } slider.src=image[num]; } setTimeout('next()',2000);

What is the difference between first-order functions and callback functions?

As far as I understand, it's the same thing. But I don't understand why the callback function is called like this. To whom does it return and what does it return? Is there a difference between first-order functions and callback functions?

Why the wow animation doesn't work.js and animate. css?

The animation should only work when you scroll to it. And it doesn't work at all. .box { width: 100px; height: 1 ... ow.min.js"></script> <script> new WOW().init(); </script> </body> </html>

How to set an iframe src using javascript

There is an Iframe <iframe src="" name="iframe1" id='iframe1'> </iframe> How can I use java script to set src to ... getElementById('iframe1').contentWindow="1.html"; } - <div onClick="IFrame1()" class='Menu3'> 1 страница </div>

TypeError: Cannot read property 'then' of undefined

There is a Token file with the request export default async function Token(email, password) { if (!res.ok) { throw new ... ace. login(email, password) .then(() => { history.push('/home'); }); Any help would be appreciated.

onChange and onKeyPress

I'm doing a site search, but ran into a problem when I hang the input 2 events onChange and onKeyPress, then onChange just re ... rderRadius: "5px"}} value={value.search} onChange={onChange} onKeyPress={onKeyPress} placeholder="Поиск"/> </form>)

Uncaught SyntaxError: Unexpected token when working with canvas

Code: var canvas = document.getElementById('canvas'); var canavs.onmousedown = onmd(); var canavs.onmousemove = onmm(); var ... error in the line - var canavs.onmousedown = onmd();. I commented out that line, and he swore at the next one. How to fix it?

What are closures in JS?

The lexical environment is clear, but how to understand closures in JS. What function it performs. You can explain it in simp ... 'Peter'; return function displayName() { console.log(name); }; } let peter = person(); peter(); // 'Peter'

Http javascript request

I just asked you a question, I probably did not express myself correctly, or I was not correctly understood. You need to make ... s, in the variable html we have html code of the site page where the request was made. The same should be done on javascript

Wysiwyg javascript editor

Good evening I'm writing a small blog engine And I need to make a simple Wysiwyg editor I don't want to use ready-made engine ... ross-browser manual? As an example, you need something like this locanic http://imperavi.com/redactor/ noo paid and on jquery

What libraries are there for viewing powerpoint presentations on the site (javascript)?

What libraries are there for viewing powerpoint presentations on your site through an iframe, for example? With the preservation of navigation and links.

How to close a browser window in a page written in ASP.NET?

I tried to close the browser window using the javascript code page windows.close(). But this command does not work. How can I close the browser window?

Selecting the value of the select element, via jquery

I know how to get the value of the selected element. The problem is with which event to catch the selection of the element. I ... ed. If you use change(), then on the contrary, the first element can not be selected in any way. Are there any other options?

Simple Calculator

Why doesn't the calculator work ? "use strict"; function CalcNumbers(result){ document.getElementById("input").i ... </div> </div> </div> <script src="calc.js"> </script> </body> </html>

bootstrap: how to "emulate" clicking on a bootstrap button from javascript?

Gentlemen, I once again ask a not very smart question. But I searched, and did not find any clear solution. I have an exampl ... () { // вот здесь я хотел бы показать модальный диалог программно } </script> </body> </html>

Drop-down menu in Bootstrap

Please tell me how in Twitter Bootstrap to make the drop-down menu drop down not when you click, but when you hover over the items? Must be done for the element dropdowns.

Transferring data to a modal window from Bootstrap

Help with the implementation of data transfer to the modal window. There is a template container that dynamically receives da ... contents of the container and the modal window. Help me correctly implement data transfer. P.S. I write in pure JavaScript.