ecmascript-6

Must use import to load ES Module webpack.config.js

I decided to try the es6 Node modules.js (those that are .mjs or "type" = "module"). I write the code in typescript, the ts-l ... ules" Mistake: TypeError: Invalid host defined options at module.exports (/home/admin/web/31_MyCMS2/webpack.config.cjs:2:18)

Importing a Node/JS, require/import, module/commonjs module

I'm trying to get through to importing modules. Desire: use require and import regardless of the module type (module_es6/com ... ) } catch (error) { console.error(error) // Must use import to load ES Module: } console.log(CONST_MOD) // undefined

Tell me how to correctly rewrite part of the code from Jquery to JS by ES6?

Hello everyone, please tell me how to correctly rewrite part of the code from Jquery to JS by ES6? Here is the site with whi ... fileReader.readAsDataURL(f); } }); } else { alert("Your browser doesn't support to File API") }

the concept of Modules in JS (ES6)?

Please explain what is the purpose of exporting and importing individual modules, if in the process of connecting js files wi ... body> </html> (Well, except for the extra request to the server) Are there any differences in this modular system ?

React Hooks (useCallback and useMemo)

Comrades.. There is a problem, I can not understand the chips of the useCallback and useMemo hooks. I have already read the d ... f what this is necessary for, what is the use of it, in what phase it happens. I would be grateful for any clear explanation.

What is the difference between promises and async await

I don't understand why it's better to use async/await instead of Promise. What does it do? Can you explain?

Why Proxy and Reflect in JavaScript, what is the difference and when and what to use?

What are Proxies useful for, and how often are they used in real development? It is also unclear about the reflexes, it turns out that this is almost the same. It is not clear why both exist at the same time.

Regular expression for searching for a mobile phone in the text

Tell me a regular expression to search for a mobile phone number in the text. Phone numbers are entered by different users a ... will be enough for. Phone examples: 8 900 000-00-00 +7 (900) 000 00-00 +7 9001112233 89001112233 8(900) 111-2233 Etc

What is the difference between JavaScript and ES6 and EC2015?

Actually, the question is: what is the difference between JavaScript and ES6, EC2015 and TypeScript? No one can really answer me on the merits. Why do I need TS for Angular 2?

The difference in behavior between let and var in the for loop

The difference in declaring a loop counter via let and var is that via var the counter variable is visible outside the loop i ... once and scrolls until the first setInterval is executed. dozens. In a word-why do these two examples have different results?

Difference between let/const and var [duplicate]

This question is already answered here: ... же самое) var App = App || {}; App.init = function() { console.log('Inited'); } App.init(); // 'Inited'

Automatic translation of ES6 to ES2015 using gulp

Installed packages npm install --save-dev gulp-babel babel-core babel-preset-env Next, the dependencies from the package. ... ch('app/*.html', browserSync.reload); gulp.watch('app/js/*.js', browserSync.reload); }); And the structure of the project

How to use the new getter and setter?

Please help me refactor the code. I wrote a component that is a form for sending questions. It also displays the questions as ... ions.push(question); }); }; .... .... But the console outputs an error: Duplicate identifier 'questions'.

Replace letters with numbers in js

I need to change all the letters in the string according to the pattern from the array. I started, but I couldn't continue. T ... "U", "V", "W", "X", "Y", "Z" ]; Input string: Tim outout string: 019008012 (019- t, 008- i, 012- m)

Correct import / export React

Tell me how to properly export and import multiple const. File const.js const activeTabs = { /*code*/ } const ... s a file App.js import activeTabs from './const'; import myContent from './const'; Returns errors or works but empty const

ECMAScript Specification or programming language?

Russian version ECMAScript is an embeddable extensible with no tools I / O programming language used as the basis for ... how, than after 20 minutes of JavaScript (a) to go to the frameworks and try to understand how everything works there - _ -

ESLint setting in VS Code: tab and end line

There is a bare project created by the Vue CLI, where ESLint does not swear at 2 spaces used as tabs (code-level indentation) ... ar that this is exactly what you need)) If ESLint doesn't have any settings, then tell me another VS Code plugin for Vue.js

How to identify the clicked child element through the click parent element event

I have the following code: <div class="tipo-cadastro"> <div class="box-logista active">Logista</div> ... I would like to know if it is possible through the click event on the parent element to know which child element was clicked?

JavaScript: differences between import and require

I know that import and require are used in JavaScript to import functions or third-party objects. It is common code snippets ... is the difference between these two approaches? When should I (or can I) use each of these approaches? Thanks for the help.

What is ECMAScript 2015 (ES6) specification?

I recently started a project with Cordova + Ionic, and at one point I got into an impasse where I found the statement that th ... such as the new ES6 specification (or ECMAScript 2015 or, still, ES2015). What would be ECMAScript 2015 (ES6) specification?