成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

js中const高級(jí)用法 Webpack怎么改html中的js路徑?

Webpack怎么改html中的js路徑?HtmlPlugin插件里配置:varhtmlWebpackPluginrequire(html-webpack-plugin);constCleanWebp

Webpack怎么改html中的js路徑?

HtmlPlugin插件里配置:

varhtmlWebpackPluginrequire(html-webpack-plugin);

constCleanWebpackPluginrequire(clean-webpack-plugin);

don'tpathsToClean[

dist,

];

module.exports{

entry:./src/app.js,

output:{

path:__dirname/dist,

filename:main.[chunkhash].js,

},

plugins:[

funhtmlWebpackPlugin({

template:,

hash:true,

filename:,

minify:{

collapseWhitespace:false

}

}),

futureCleanWebpackPlugin(pathsToClean),

],

module:{

rules:[

{

test:/.css$/,

use:[style-loader,css-loader]

}

]

}

};

jsp中怎么添加dom元素?

是可以直接在html里先添加,也可以用js添加,用js去添加的舉例不勝感激:

ltscriptgt

const(#34ul#34)

for(let i1ilt5i){

const(#34li#34)

li.textContent`item${i}`

(li)

}

(ul)

lt/scriptgt

JavaScript如何獲取數(shù)組維度?

例如一個(gè)二維數(shù)組,經(jīng)過處理后能得到3;一個(gè)四維數(shù)組處理后能得到4;項(xiàng)目中雖然不廣泛甚至于用不了但要是有大佬明白了的話求指教,有勞。.例如[1,2,[3,4],5,[6,7],8,9]這個(gè)數(shù)組當(dāng)經(jīng)過一些代碼這個(gè)可以(假如是可以的話)能得到一個(gè)i2;,.例如[1,2,[3,4],5,[6,[10,11],7,8],9]這個(gè)數(shù)組在一些代碼是可以(要是也可以的話)換取一個(gè)i3。

functiongetDepth(arr){

consteleDepths[]

(elea8{

letdepth0

if((ele)){

depthgetDepth(ele)

}

eleDepths.push(depth)

})

return1max(eleDepths)

}

functionmax(arr){

return((accu,curr)gt{

if(currgtaccu)returncurr

returnaccu

})

}

//test

constarr1[1, 2, 3]

constarr2[1, 2, 3,[1,2]]

constarr3[1,[1,[1,2]],3]

constarr4[1,[1,[1,2]],3,4,[1,[1,[1,3]]]]

console.log(getDepth(arr1))//1

console.log(getDepth(arr2))//2

console.log(getDepth(arr3))//3

console.log(getDepth(arr4))//4