我们真的可以删除由es6"class"创建的类吗?
class myClass{}
delete myClass;
console.log(myClass); //output: class myClass{}
var myClass=0; //Uncaught SyntaxError: Identifier 'myClass' has already been declaredRun Code Online (Sandbox Code Playgroud)
我在 Firebase 托管上部署了一个静态站点,并带有一些标头配置。但是我的一些标题在站点部署后没有出现。
我尝试更改Cache-Controlheader的值并且它有效。但是X-Frame-Options,Content-Security-Policy,X-Content-Type-Options没有。
firebase.json:
{
"hosting": {
"public": "public",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"headers": [
{
"source": "**/*.@(html)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "Content-Security-Policy",
"value":
"script-src 'self' 'unsafe-inline' cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline' cdnjs.cloudflare.com"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png|ico|svg)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=2592000"
}
]
},
{
"source": "**/*.@(js|css)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=2592000"
} …Run Code Online (Sandbox Code Playgroud) 作为标题,如何在浏览器中检测async/await es7支持?
那可能吗?
如果我有很多承诺,我可以简单Promise.all地等待所有承诺。
但是,当我有一个对象数组时,每个对象都具有应有的某些属性,有没有好的方法来处理它?
例:
const files=urlOfFiles.map(url=>({
data: fetch(url).then(r=>r.blob()),
name: url.split('/').pop()
}))
//what to do here to convert each file.data to blob?
//like Promise.all(files,'data') or something else
Run Code Online (Sandbox Code Playgroud) javascript ×4
ecmascript-6 ×2
async-await ×1
asynchronous ×1
babel ×1
class ×1
firebase ×1
http-headers ×1
promise ×1
syntax ×1
unicode ×1