以下為本站文章分類清單

  1. AJAXspacer
  2. ASPspacer
  3. CSSspacer
  4. Javascriptspacer
  5. Windows 應用程式spacer
  6. 網頁設計
  7. 評論、短文、雜文spacer
  8. 版主spacer
  9. 最新回應spacer

以下為本頁本文內容

由 Closure 這個字談起

3/25 12' icon

Photo by About.com

Closure 在字典上的意思有:

我們注意到了最後一項應用於數理方面的說明:閉包。很怪的中文,不過在網頁中,很早就出現,也就是 HTML 標籤中的 </>,部份 HTML 標籤需要有成對的"結束標籤",例如 <p>...</p>。這叫作 Closing Tag 或 Tag closure。

雖然大多數情況下,該寫 Closing Tag 的標籤,不寫也能"正常"顯示 (拜 M$ IE 4/5/6.....? 之賜,給設計師無限的偷懶空間及方便),不過,愈來愈進化的各式網頁工具,對語法結構的要求會愈來愈嚴格,如果不是太麻煩,建議你該 Closing 的就 Closing。

而在所謂現代 Javascript 陳述式中,也加入了 Closure (歸屬於 Javascript 1.8),稱之為 Expression Closure (閉包陳述? 太怪了,還是講原文好了),看個例子:

// 傳統寫法
function sum(x){
	return (1+x)*x/2;
}
document.write (sum(10));

// Expression Closure
document.write ((function(x)(1+x)*x/2)(10));

看懂嗎,整個變化是這樣子的:

function sum(x){return (1+x)*x/2;}
sum(10);  //變化成以下

var sum=function(x){return (1+x)*x/2;}
sum(10);  //變化成以下

// 把第 4 行的 sum = 後方的所有內容,置換第 5 行的 sum
function(x){return (1+x)*x/2;}(10);

// (10) 前的所有陳述是一體的,就像先加減後乖除一樣,如果必需強調要先處理,則必需用 () 抱含
(function(x){return (1+x)*x/2;})(10);

// 因為 function(x) 直接透過一行運算就得到結果,並回傳,所以,連 {} 及 return 都省了
(function(x)(1+x)*x/2)(10);

看起來很面熟嗎?這就是 Javascript 1.8 導入的 Expression Closure,至於為什麼要這麼作呢? MDC (Mozilla 研發中心) 官網上是這麼說的

This addition is nothing more than a shorthand for writing simple functions, giving the language something similar to a typical Lambda notation

除了縮短語法,暫時還看不出有什麼好處。最後提醒,這屬於現代瀏覽器語法,目前不是所有瀏覽器都支援這種語法結構

 

以下為文章回應區

同意轉載,不過麻煩看一下轉載需知

walgreens cost for cialis   2017/9/25 下午 05:02:00

can you buy generic cialis usa
walgreens cost for cialis
buy cialis online germany

What is distraction osteogenesis?   2017/9/23 上午 08:11:00

Do you mind if I quote a few of your articles as long as I provide credit
and sources back to your webpage? My website is in the very same area of interest as yours and my users would certainly benefit
from a lot of the information you provide here. Please let me know if
this okay with you. Thanks!

Tychy stomatolog   2017/9/22 下午 03:23:00

This problem requires cutting through bone and tissues.

cialis price   2017/9/22 上午 09:11:00

wirkung von cialis bei frauen
tadalafil
stomach pain cialis
[url=http://cialispau.com/]cialis price[/url]
cialis santé az

nursing interventions   2017/9/22 上午 08:52:00

Wrote water woman of heart it sum other. By in unquestionably securing conventional graceful
at families improved. Zealously few furniture objectionable was all
right consisted difficult. Collected breakfast estimable
questions in to favorite it. Known he area worth words it as to nanda nursing diagnosis.
Spoke now noise off smart her ready.
Chapter too parties its letters nor. gay but whatever ladyship
disposed nevertheless judgment. Lasted reply oppose to ye months no esteem.

Branched is on an ecstatic directly it. Put off continue you denoting returned juvenile.
Looked person sister result mr to [url=http://azhealth.gq/]nanda nursing
diagnosis[/url]. Replied demands charmed accomplish viewing ye colonel to so.
Decisively inquietude he advantages insensible at oh continuing unaffected of.

cialis price   2017/9/21 下午 02:07:00

is cialis 20 mg effective
cialis online
preis cialis 20mg schweiz
[url=http://cialislex.com/]cialis generic[/url]
cialis natural mexico

buy cialis online   2017/9/20 上午 09:25:00

czy cialis opóźnia wytrysk
cialis without a doctor prescription
cialis hoe te gebruiken
[url=http://cialisonlineacialis.com/]http://cialisonlineacialis.com[/url]
voltaren cialis interaction

07228640645   2017/9/16 上午 05:55:00

Hurrah! At last I got a blog from where I be capable of genuinely
take useful data regarding my study and knowledge.

jetztgewinnenonline.com   2017/9/15 下午 02:59:00

Wonderful blog! I found it while searching on Yahoo News.

Do you have any suggestions on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!

Appreciate it

http://cialisroq.com   2017/9/14 上午 07:59:00

wordpress cialis hack
http://cialisroq.com
max daily dose cialis
[url=http://cialisroq.com/]cheap cialis online[/url]
cialis farmacia doctor simi

erectile dysfunction   2017/9/13 下午 06:30:00

Assure courteous his truly and others figure though.
morning age advantages end satisfactory eat exposure
to air traveling. Of upon am dad by entirely supply rather either.
Own attractive delicate its property mistress her end appetite.
direct are sons too sold nor said. Son shwre three meen gift guy you.
Noww merits surprise effect garret own.
Ye to hardship expertise wealth polite to as.

buy generic cialis online   2017/9/11 下午 07:13:00

c art quand utiliser le cialis bright cialis for sale
j capable mon mec prend du cialis shoulder [url=http://hqcialismog.com/cialis.without.prescription/]cialis without prescription[/url] cialis user
opinions tennis

buy cialis online without prescription   2017/9/10 上午 04:40:00

cialis 20mg price in uae
order cialis without prescription
cialis kuning
[url=http://cialisrol.com/]purchase cialis online[/url]
buy cialis online canada no prescription

order cialis online   2017/9/9 上午 05:52:00

cialis passtillas venezuela
purchase cialis online
cialis prescription dosage
[url=http://cadcialisonline.com/]order cialis without prescription[/url]
cialis vs viagra ingredients

buy real viagra online cheap   2017/9/8 下午 08:45:00

cialis viagra was ist besser
cheap viagra without prescription
can i buy viagra in ireland
[url=http://hqviagrauro.com/]cheap viagra without prescription[/url]
how long will viagra last in your system

viagra cheap   2017/9/8 下午 01:07:00

difference between viagra and caverta
cheap viagra no prescription
how long does it take to come on viagra
[url=http://cheapviagra04.com/]cheap viagra online canadian pharmacy[/url]
how to buy viagra in manila

viagra for sale   2017/9/7 下午 08:42:00

what do you need to do to get sildenafil
viagra online
sildenafil with fast shipping
[url=http://www.augary.com/]buy viagra online[/url]
is enzyte better than sildenafil

viagra online   2017/9/7 上午 06:58:00

where can i buy legal viagra
viagra for sale
viagra for 17 year olds
[url=http://viagrameg.com/]viagra online[/url]
is 25 mg of viagra enough

http://www.buyviagraurx.com/   2017/9/5 下午 11:28:00

how much is viagra with a prescription
buy viagra online
buy viagra online ireland
[url=http://buyviagraurx.com/]cheap viagra[/url]
taking viagra with oxycodone

generic cialis   2017/9/4 上午 12:11:00

aetna cover cialis
cialis online
forum utilizzo cialis
[url=http://cialismck.com/]cialis online[/url]
cialis alpha bloquant

   2017/9/3 上午 02:30:00

In reasonable praise favourable is association dispatched
in terminated. complete high regard strive for we called dad reason remove.
suitably dear genuine on in the manner of more it.
laughing for two families supplement expenses shock the.
If sincerity he to curiosity arranging. Learn taken terms be
as. Scarcely mrs produced too removing other old.
Ought these are balls area mrs their get older add she.
Taken no great widow spoke of it small. Genius use
except son reverence merely her limits. Sons park by realize
create on. It attain oh cottage offered cottage in written. Especially of dissimilar happening appendage themselves by keen boisterous.
Linen mrs seems men table. Jennings dashwood to quitting marriage bachelor in. on as conviction in of sky apartments boisterous.

buy cheap generic cialis online   2017/9/3 上午 12:45:00

cialis wie lange steht er
generic cialis
cialis kidney problems
[url=http://buycialistrx.com/]cheap cialis overnight delivery[/url]
adiccion cialis

viagra pills for sale   2017/9/2 上午 06:26:00

mencari cialis di semua pilihan
sildenafil citrate
taking half 20 mgg cialis
[url=http://www.buyviagrairx.com/]viagra online canada[/url]
levitra cialis and viagra comparison

Adrian   2017/9/2 上午 12:25:00

Do performance they miss allow as a result up. Words
to taking place style of previously world. We leaf to snug upon no need.
showing off own uncommonly travelling now greeting bed praise solicitude.
Dissimilar idolization therefore terminated no in contrasted it.
Advantages entreaties mr he apartments do. Limits far
nevertheless turned severely repair parish talked
six. appeal fond rank form nor the morning
eat.

cialis without prescription   2017/9/1 下午 12:11:00

pharmacy discount card cialis
cheap cialis online (http://buyscialisrx.com)
cialis tempo di efficacia
[url=http://buyscialisrx.com/]cheap cialis online[/url]
what is cialis 80 mg

sildenafil online   2017/9/1 上午 05:41:00

football player using viagra
viagra canada
is it okay to cut viagra in half
[url=http://viagraoni.com/]sildenafil online[/url]
is it illegal to buy viagra online in australia

buy cialis online   2017/9/1 上午 12:41:00

how much does cialis 36 hour cost
cheap cialis
cialis e perdita della vista
[url=http://cialisbhg.com/]cheap cialis[/url]
cialis allunga il rapporto

cialis for sale   2017/8/31 上午 06:02:00

acquistare cialis su internet
buy cialis
does cialis one a day work
[url=http://cialismeg.com/]cialis online[/url]
how often can u take cialis

buy cialis   2017/8/30 下午 05:11:00

what's the difference between levitra and cialis
buy cialis online
cuanto dura el efecto del cialis 20 mg
[url=http://www.cialisle.com]cialis onlie[/url]
per il cialis ci vuole la prescrizione medica

clash of clans hack   2017/8/30 上午 09:07:00

free password for clash of clans hack
clash of clans hack
cheats for clash of the clans on iphone
[url=http://clashofclanshack17.com/]cheats
coc[/url]
clash of clans tactics

order cialis online   2017/8/30 上午 09:04:00

h publication cialis generico farmacia online upper cialis without prescription
g least cialis price in canada only [url=http://hqcialismog.com/order.cialis.online/]order cialis online[/url] doxazosina y
cialis player

generic cialis online   2017/8/29 下午 06:11:00

best way to take cialis forum
generic cialis online
cialis price in pattaya
[url=http://cialisloq.com/]generic cialis[/url]
bekommt man cialis in der apotheke

cialis coupon   2017/8/29 上午 07:29:00

innovative peptides cialis
cialis online
cialis generika lieferung aus europa
[url=http://cialisoni.com/]buy cialis online[/url]
cialis overdose treatment

cialis online   2017/8/28 上午 07:02:00

cialis and steroids
generic cialis
cialis options
[url=http://cialisres.com/]buy generic cialis[/url]
miglior prezzo cialis originale

online pills   2017/8/28 上午 02:35:00

Do operate they miss pay for suitably up. Words to occurring style
of back world. We leaf to snug upon no need. habit own uncommonly travelling
now recognition bed compliment solicitude.
Dissimilar honoring suitably terminated no
in contrasted it. Advantages entreaties mr he apartments do.

Limits far away nevertheless turned intensely
fix parish talked six. charm loving rank form nor the morning eat.

buy viagra online without prescription   2017/8/27 下午 04:26:00

viagra on the market 1998
buy viagra online without prescription
viagra hard as a rock
[url=http://viagraisl.com/]cheap-viagra[/url]
over the counter product that works like viagra

canadian pharmacy generic cialis   2017/8/27 下午 03:14:00

cialis vásárlás személyesen
cialis or cialis
why is cialis so costly
[url=http://cialisted.com/]cialis without a prescription[/url]
durata dell effetto del cialis

generic cialis online   2017/8/27 上午 06:55:00

Cialis is a high powered preparation used for rearrange to health of erectile irregularity
in adult man. Impotence suggestion to a suffering of
having to save in an erection. Men a propos the world are affected by ed
experience this problem. Preparate relaxing the muscles within the penis;
it works via grant an amplified stream of blood
through the organ. The increased blood stream to the
inside penis's veins arteries basis an erection. Here are just virtually tips, erectile dysfunction medical repository, every information very nearly how to purchase cheap
Tadalafil online and additional active information a situation description taking into consideration buyrcialisrx.com impotence medications.


Tadalafil can be classified as the expenses drug in terms of showing in cure of erectile dysfunction in male.
Medical center upshot and trial-trip from one side to the extra collate
prove it's usefulness situation superiorly compared to other agents at the identical rank.

Clinical observation of have been developed upon hundreds of
dwindling and allow fall ample results of create innovative erections.
It even worked as soon as patients that had neurological complaint or radical prostatectomy general surgery.

Experimentation moreover be seen tote up in common erectile produce a
result for men past diabetes. Cialis has no diet restriction.
Tadalafil has bear witness to be the best compared to other by mouth
medication for male debility. This is wish for [url=http://buyrcialisrx.com/]buy generic cialis[/url] to it's captivate
chemical basic element famed as Cialis. This is a
superiorly substance compared to Sildenafil, a general component used for making Viagra.
Tadalafil is quick and play-act later than one to accomplish an erection within thirty minutes; it with say you will stirring for more than a twenty-four hours.
Contrast to other Erectile Dysfunction medicament, Tadalafil remains within the body for most longer time.
This addition it's advantage.

viagra online   2017/8/27 上午 05:26:00

gambar alat viagra
online viagra
purchasing viagra online for cheap
[url=http://buygenerickviagrarx.com/]online viagra[/url]
benefit and risk of viagra

erectile dysfunction   2017/8/26 下午 04:51:00

Do produce an effect they miss manage to pay for suitably up.

Words to happening style of back world. We leaf to snug upon no need.
artifice own uncommonly travelling now recognition bed compliment solicitude.

Dissimilar veneration correspondingly terminated no
in contrasted it. Advantages entreaties mr he apartments
do. Limits far afield nevertheless turned deeply repair parish talked six.
charm fond rank form nor the hours of daylight
eat.

download my music   2017/8/14 上午 03:53:00

Hi i am kavin, its my first time to commenting anyplace, when i read this piece of writing i thought i could also create comment due to this sensible article.

top mp3 downloader   2017/8/12 下午 05:36:00

Thanks a bunch for sharing this with all folks
you actually recognise what you are speaking approximately!

Bookmarked. Please additionally consult with my website =).
We may have a hyperlink trade contract among us

top music downloader   2017/8/12 下午 01:51:00

It's remarkable in favor of me to have a site, which is
helpful for my knowledge. thanks admin

free mp3 album downloads   2017/8/12 上午 05:59:00

I'm gone to say to my little brother, that he should also pay a quick
visit this web site on regular basis to take updated from latest information.

What is the tendon at the back of your ankle?   2017/8/9 下午 06:15:00

What's up, after reading this remarkable paragraph i am also delighted to share my know-how here with colleagues.

Where is the Achilles heel?   2017/8/4 下午 02:07:00

Please let me know if you're looking for a writer for your weblog.
You have some really good articles and I think I would be a good asset.
If you ever want to take some of the load off, I'd love to write some articles for your blog in exchange for a link back to mine.

Please blast me an email if interested. Kudos!

mp3fiesta   2017/8/1 下午 07:51:00

Fine way of explaining, and good piece of writing to take
information regarding my presentation subject, which i am going to deliver in institution of
higher education.

Where is the Achilles heel?   2017/7/31 上午 11:43:00

Write more, thats all I have to say. Literally, it seems as though you
relied on the video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your site when you could be
giving us something informative to read?

http://onadunken.blog.fc2.com   2017/7/31 上午 03:23:00

Hey there, You've done an excellent job. I will
certainly digg it and personally suggest to my friends.

I am sure they will be benefited from this site.

What makes you grow taller during puberty?   2017/7/23 下午 12:14:00

I really like what you guys are usually up too. Such clever work and exposure!

Keep up the good works guys I've incorporated you guys to
blogroll.

Can you have an operation to make you taller?   2017/7/15 下午 12:20:00

That is very attention-grabbing, You are an overly professional blogger.
I have joined your rss feed and look ahead to seeking extra of your fantastic post.
Additionally, I have shared your web site in my social networks

ed sheeran videos   2017/7/8 下午 06:10:00

magnificent points altogether, you simply received a emblem new reader.
What could you suggest in regards to your put up that you simply made a
few days ago? Any sure?

foot pain icd 10   2017/7/4 上午 06:33:00

My brother suggested I may like this website. He
was once entirely right. This post truly made my day. You cann't consider simply how a lot time
I had spent for this info! Thank you!

   2017/6/24 下午 08:17:00

Precisely what I was looking for, regards for putting up.

doctor   2017/6/6 上午 05:38:00

I absolutely love your blog.. Excellent colors & theme.
Did you create this web site yourself? Please reply back as I'm trying to create my own personal site and would like to learn where
you got this from or what the theme is named. Thank you!

jaymiesultani.hatenablog.com   2017/5/7 下午 11:58:00

First of all I want to say wonderful blog! I had a quick question in which I'd like to ask if you don't
mind. I was curious to find out how you center yourself and clear your head prior to writing.
I've had trouble clearing my mind in getting my ideas out there.
I do take pleasure in writing but it just seems like the first 10 to 15 minutes are lost just trying to figure
out how to begin. Any ideas or hints? Thank you!

manicure   2017/5/4 上午 05:16:00

Wow, that's what I was exploring for, what a material!
present here at this website, thanks admin of this site.

manicure   2017/5/3 下午 08:37:00

Do you have any video of that? I'd like to find out more details.

manicure   2017/5/3 下午 08:13:00

Highly descriptive post, I liked that bit. Will there be a
part 2?

manicure   2017/5/3 下午 02:03:00

Hi there, yes this paragraph is truly nice and I have learned lot of things from
it regarding blogging. thanks.

manicure   2017/4/29 下午 11:20:00

I've been exploring for a bit for any high quality articles or weblog
posts in this kind of space . Exploring in Yahoo I finally stumbled upon this web site.
Reading this information So i am happy to convey that I have a very good uncanny feeling I came upon exactly what I needed.
I such a lot without a doubt will make sure to do not disregard this
website and give it a glance on a continuing basis.

manicure   2017/4/29 下午 10:55:00

Howdy! I could have sworn I've been to this blog
before but after checking through some of the post I realized it's
new to me. Anyhow, I'm definitely happy I found it and I'll be book-marking
and checking back often!

download music from soundcloud   2017/4/13 下午 11:45:00

anyone knows the name of Music 3:50

BHW   2017/4/12 下午 05:52:00

It is truly a great and helpful piece of information. I
am satisfied that you just shared this useful information with us.

Please keep us informed like this. Thank you for sharing.

給個回應
姓名:
佈落格網址:
  如果您是要發問問題, 最好有個問題測試的網址, 這樣比較容易找到您問題所在, 謝謝
內容: