因?yàn)閒n是個(gè)匿名函數(shù)
舉個(gè)簡(jiǎn)單例子
var obj = {
fn1: function() {
console.log(this);//此處輸出obj本身
var noNamed = function() {
console.log(this);//此處輸出windowd對(duì)象
};
return noNamed();
}
};
obj.fn1();
以上,你的var fn=function(){};
再return fn()
本質(zhì)上就是個(gè)直接調(diào)用的匿名函數(shù)閉包 return function(){}
你只是將這個(gè)匿名函數(shù)賦值給fn了,并不能改變他沒函數(shù)名的本質(zhì)
結(jié)論:只要是匿名函數(shù),this就指向window全局對(duì)象,例如:
function foo() {
var fn = setTimeout(function() { //我是匿名函數(shù)
console.log(`setTimeout的this不會(huì)隨foo改變:${this.age}`);
}, 0);
}
foo.call({
age: '1000'
});//輸出undefined
為什么要用 file_get_contents ?沒用框架?那直接用html表單上傳,后臺(tái)用$_FILES看看速度如何
this.keys["similar"] = similar;
this.keys["relative"] = relative;
CSS+SVG,這里有個(gè)鮮活的例子
為什么最后一處是false?
Object.create創(chuàng)建了一個(gè)新的object,具體實(shí)現(xiàn)方式類似于下面
Object.create = function (o) {
var F = function () {};
F.prototype = o;
return new F();
};
const reducer = (state = {}, action) => {
switch (action.type) {
case 'chinese':
return {
...state,
...{msg: '這是Redux啊'}
}
case 'english':
return {
...state,
...{msg: "This is Redux"}
}
default:
return state
}
}
改成這樣
已解決.. 使用多個(gè)serviceId可以解決這種情況;
后面會(huì)整理發(fā)出;
終于解決了?。?!感謝52.參見https://www.52pojie.cn/forum....
parse相關(guān)函數(shù), 處理url parse_url(), 處理?后面帶的數(shù)據(jù) parse_str()
$url = 'http://www.abc.com/?title=ww&imgFile=%2Fpublic%2Fupload%2Fimage%2F20180712%2F20180712024544_27715.jpg';
$urlArray = parse_url($url);
print_r($urlArray);
parse_str($urlArray['query'], $paramList);
print_r($paramList);
exit;
結(jié)果
Array
(
[scheme] => http
[host] => www.abc.com
[path] => /
[query] => title=ww&imgFile=%2Fpublic%2Fupload%2Fimage%2F20180712%2F20180712024544_27715.jpg
)
Array
(
[title] => ww
[imgFile] => /public/upload/image/20180712/20180712024544_27715.jpg
)
static
,靜態(tài)變量,了解一下。
將
"css-loader",
"postcss-loader",
改為:
{loader: 'css-loader',options: { importLoaders: 1 }},
{loader: 'postcss-loader',options: { config: { path: path.resolve(__dirname, './postcss.config.js') } },
我是在這里找到的答案:
https://github.com/webpack-co...
1 先用正則表達(dá)式,按照 數(shù)字冒號(hào)(1:,2:)拆分單條信息
得到結(jié)果:
[
'1:公司名:An網(wǎng)站:wwwn電話:123456789n',
'2:公司名:An網(wǎng)站:wwwn電話:123456789nn',
'3:公司名:An網(wǎng)站:wwwn電話:123456789地址:abbn',
'4:公司名:An網(wǎng)站:wwwn電話:123456789',
]
2 取出每一項(xiàng)目,將數(shù)字冒號(hào)(1:)替換為空
如:'1:公司名:An網(wǎng)站:wwwn電話:123456789n',
3 按照n拆分,再按照:區(qū)分鍵值對(duì)。
如:'公司名:An網(wǎng)站:wwwn電話:123456789n',
得到結(jié)果:[{'公司名':'A'},{'網(wǎng)站':'www'},{'電話':'123456789'}]
Web App側(cè)重“功能”,是使用網(wǎng)頁技術(shù)實(shí)現(xiàn)的App??偟膩碚f,Web App就是運(yùn)行于網(wǎng)絡(luò)和標(biāo)準(zhǔn)瀏覽器上,基于網(wǎng)頁技術(shù)開發(fā)實(shí)現(xiàn)特定功能的應(yīng)用。比如谷歌搜索引擎就是一個(gè)webApp,它有一個(gè)特定的功能,所以可以稱為webapp
https://baike.baidu.com/item/...
PWA可以添加至主屏幕,點(diǎn)擊主屏幕圖標(biāo)可以實(shí)現(xiàn)啟動(dòng)動(dòng)畫以及隱藏地址欄,實(shí)現(xiàn)離線緩存功能,即使用戶手機(jī)沒有網(wǎng)絡(luò),依然可以使用一些離線功能,實(shí)現(xiàn)了消息推送。
https://segmentfault.com/a/11...
CSS:before and after
browserSync.init({
server:{
baseDir:paths.source.root
},
open:"external" //自己瀏覽器的IP
});
Java中的label標(biāo)記,類似于C語言的goto,可能是object:迷惑了你,你可以任意寫一個(gè)字符串(非關(guān)鍵字)都能編譯通過。
export class HeaderComponent implements OnInit {
private timer = 0;
public settingDialog = false;
...
toggleSetting(isShow: any) {
const show = !!isShow;
clearTimeout(this.timer);
if (!show) {
// delay 600ms for hide
this.timer = setTimeout(() => {
this.settingDialog = show;
}, 600);
return;
}
this.settingDialog = show;
}
...
}
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。