function f2() { try { Promise.reject( ); } catch(e) { console.log(e) } } execute f2 () , and Uncaught (in promise) cannot be thrown from the promise.reject, console captured by try catch. async function f() { try { await Pr...
let keys = [ a , b ] let vals = [ [111, 222], [333, 444] ] expected result: [{a:111,b:222},{a:333,b:444}] ...
beginners, want to know where the error is, all the materials found are introduced the following is my streamlined code. The error prompt is error prompt on the main.js import line: SyntaxError: Unexpected token { . Import call expects exactly one ...
var testVar; for(var i=0;i<3;iPP){ testVar=function(){ console.log(i) }; } testVar(); 3 let testVar; for(let i=0;i<3;iPP){ testVar=function(){ console.log(i) }; } testVar(); 2 A reference to I is saved in the closure i...
I don t like using plug-ins want to implement a list of multi-layer telescopic folds at present, the picture is the effect that comes out of my stool. Do you have any good logic for unfolding and merging? html: .list(v-for="(i, n) in t...
the first time I developed Mini Program, I saw that Mini Program could set es6 to es5, so I used some es6 syntax, such as let, const, arrow function and this in it. But I don t know if Mini Program will be all right in the low version of Android browser...
there are three pages in total. By default, they point to the login page. After logging in, you can store client_id to cookie and global.CLIENT_ID . what I want to do is to check the login status. When the page jumps, check that global.CLIENT_ID or coo...
this.array = [ [ 0.6 , 138 ], [ 0.674 , 135 ], [ 0.77 , 81 ], [ 0.8 , 5 ] ]; the es6 method I found is using map,. I do this with the for loop, but I don t know how to assign the changed value to the original this.array . Wrong...
use the swiper plug-in to put js into stat and quote the Times incorrectly. I made this mistake after I installed it with npm. Excuse me, what s going on? The mistake of Zongbao error as shown in the figure! ...
is not a simple thing. is nothing more than rendering, but heavy rendering only increases the amount of code, while the actual business is a little more complicated. I write WeChat Mini Programs and then use react to make simple problems more complica...
first of all, import is not supported before Node 9. I made it possible to use import, in Node by introducing babel-cli and babel-preset-es2015 , but I still had a problem when importing axios. I didn t add a path when I import, which is similar...
I am a novice. Recently, I read the chapter of inheritance of class in teacher Ruan Yifeng s es6 . I don t understand some concepts of super . The details are as follows: there is a code like this in teacher Ruan Yifeng s blog: class A { cons...
titles = titles+ `<tr> <td class="txt-td-a">${arr[i].keyCode}< td> <td class="txt-td-b chang${i}">${arr[i].keyValue}< td> <td class="txt-td-c "> <a n...
let a = [ { name:"1", status:"1" }, { name:"2", status:"1" }, { name:"3", status:"2" }, { name:"4", status:"2" }, { name:"5", status:"3" }, { name:"6...
is to see the demo code in Ruan Yifeng s ES6 bablees5 question: 1. So you have to use module.exports and require? to use module. two If you follow the above method, it is not still to import the whole module and then read specific proper...
const arr1=[{id:1,name: },{id:2,name: }] const arr2=[{id:1,name: },{id:3,name: }] the es6 method Filter drops the same items of id and arr1 id in arr2 ...
alias has been configured with assets I wonder if it is because require is introduced at run time in computed that cannot be found. I want to use the second way to write it so that I don t want to load useless pictures, or you can tell me how to g...
js beginners, want to achieve an effect check a bunch of input selection boxes. If anyone is selected, click the delete button to delete the selected input . There are two questions . 1. Why use foreach to print the checked of each input is true? ...
my Chrome version is 66.0.3359.139, and I want to use es syntax directly in js. Why can t it succeed? I don t want to use babel and webpack,. I just want to experiment with Chrome s support for es. my project structure is shown below: index page i...
this is what I do now. Is there a better way? let flag = true const listA = [1, 2, 3] const listB = [2, 3, 4] if (listA.length !== listB.length) { flag = false } else { listA.forEach(item => { if (listB.indexOf(it...
the introduction of a third-party library prompted that the module declaration could not be found, and there was no declaration file maintained on the Internet, so I wrote .d.ts myself. declare module username {export name: string} Why does th...
to develop a new set of shopping malls, I want to use swoft in the project, but I don t have any relevant experience. I wonder if it is possible to abandon php-fpm completely? nginx is only used to reverse proxy or process static files! for those o...
Why does it not work to directly set the font size and color of I? the code is as follows <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content=&qu...
the scene is shared to the address of qq Wechat Weibo. Users need to jump to app or download it after opening it. Now ios test is almost done, Android test can not open app, excuse me is the Android writing is not the same. Don t recommend tools that n...
our company wants to develop a new feature, which is kind of like note-taking. allows users to copy content from a web page and paste it into an editor that retains the original text styles, images, and so on. Just like Youdao cloud notes and Evernote,...