JS基础教程——JavaScript基础知识(1.3对象-1.3.2对象常量)

2013-12-20 liyangweb.com 李杨 JavaScript

JavaScript中也有类似“对象常量”的语法,即在创建自己的对象时不需要任何额外的语法。下面的代码相信你会非常熟悉:

alert("hello world");


可以很明显的发现,alert是一个函数,而字符串"hello world"是该函数唯一的参数。这样就避免了之前经常写的一种情况:

var str = "hell world";
alert(str);


JavaScript知道所有包含在一对双引号(" ")中的内容都应该作为字符串来处理,无论在何处写下该字符串,JavaScript都会进行必要的处理,从而使该字符串生效。该字符串的创建与传入该函数是同时进行的。在形式山,"hello world"是作为一个字符串常量来引用的,为了创建字符串常量,需要将字符串常量的内容逐字打出来。

标签: JavaScript JS基础教程

评论:

obervall
2019-02-07 23:19
<a href="http://www.akncmusic.com/nike-air-max-lunar-1-deluxe-nero-dove-kurpesc">nike air max lunar 1 deluxe nero dove</a> <a href="http://www.dystopianflix.com/nfl-ty-montgomery-ash-88-baltimore-ravens-nike-one-color-t-shirt-nflx">nfl ty montgomery ash 88 baltimore ravens nike one color t shirt</a> <a href="http://www.getunladylike.com/nike-hyperdunk-2014-low-gris-rojo-obuvd">nike hyperdunk 2014 low gris rojo</a> <a href="http://www.jesselyon.com/enfants-chaussures-jaune-or-scarpec">enfants chaussures jaune or</a> <a href="http://www.kabukcuoglu.com/zx-700-hvid-l%C3%A6der-pants-kurpesb">zx 700 hvid l忙der pants</a> <a href="http://www.karbasioun.com/limited-nike-pink-womens-frank-gore-jersey-nfl-21-miami-dolphins-rush-fashion-nflr">limited nike pink womens frank gore jersey nfl 21 miami dolphins rush fashion</a>
obervall http://www.obervall.com/
chainoffshore
2019-01-30 20:57
<a href="http://www.gandilyan.com/new-balance-boots-womens-skot">new balance boots womens</a> <a href="http://www.lakefrontlane.com/boots-jimmy-choo-gift-set-louboutinr">boots jimmy choo gift set</a> <a href="http://www.thesleeperson.com/billig-nike-blazer-low-herre-s%C3%B8lv-sneakerb">billig nike blazer low herre s酶lv</a> <a href="http://www.thecoedge.com/nike-zoom-winflo-3-white-brown-skoc">nike zoom winflo 3 white brown</a> <a href="http://www.blackkinesis.com/louboutin-cheetah-pumps-kit-louboutinc">louboutin cheetah pumps kit</a> <a href="http://www.selfdriverbus.com/where-can-i-get-pandora-charms-from-pandorar">where can i get pandora charms from</a>
chainoffshore http://www.chainoffshore.com/
glennloovens
2019-01-29 13:12
<a href="http://www.khalataxi.com/2014-15-chelsea-fc-26-terry-home-soccer-shirt-kit-nflv">2014 15 chelsea fc 26 terry home soccer shirt kit</a> <a href="http://www.miaclearbras.com/nike-free-run-5.0-mens-orange-black-skof">nike free run 5.0 mens orange black</a> <a href="http://www.divyangbazar.com/air-max-damen-pink-schwarz-skob">air max damen pink schwarz</a> <a href="http://www.dixiepundit.com/rockstar-hats-for-sale-mn-hatd">rockstar hats for sale mn</a> <a href="http://www.ifshaildamage.com/ebay-air-max-95-runningf">ebay air max 95</a> <a href="http://www.nanterrelec.com/asics-gel-noosa-tri-9-dam%C3%A4nner-laufen-schuhe-uk-kit-schuhea">asics gel noosa tri 9 dam盲nner laufen schuhe uk kit</a>
glennloovens http://www.glennloovens.com/
gcoarpgb
2019-01-12 06:34
<a href="http://www.72y9pzek.com/jordan-retro-4-hvit-svart-r%C3%B8d-schuhed">jordan retro 4 hvit svart r酶d</a> <a href="http://www.ata4l20x.com/air-jordan-jumpman-viola-rosa-obuvg">air jordan jumpman viola rosa</a> <a href="http://www.avoqyd09.com/nike-air-max-2016-marina-militare-kurpesf">nike air max 2016 marina militare</a> <a href="http://www.ds432gxe.com/air-jordan-b-mo-marrone-oro-kurpesf">air jordan b mo marrone oro</a> <a href="http://www.6mohycx0.com/nike-air-huarache-high-top-noir-schuheg">nike air huarache high top noir</a> <a href="http://www.rnokcrc1.com/under-armour-clutchfit-drive-negro-amarillo-amarillo-scarpef">under armour clutchfit drive negro amarillo amarillo</a>
gcoarpgb http://www.gcoarpgb.com/
virginiaflyin
2019-01-11 23:37
<a href="http://www.lumalender.com/asics-gel-quantum-360-negro-marr%C3%B3n-obuvc">asics gel quantum 360 negro marr贸n</a> <a href="http://www.millertiregi.com/air-max-thea-mujeres-p%C3%BArpura-zebra-scarpea">air max thea mujeres p煤rpura zebra</a> <a href="http://www.bkgutters.com/jordan-retro-4-fire-r%C3%B8d-mars-schuheb">jordan retro 4 fire r酶d mars</a> <a href="http://www.celebritywm.com/limited-nike-brown-womens-tyrod-taylor-jersey-nfl-5-cleveland-browns-rush-drift-fashion-nflr">limited nike brown womens tyrod taylor jersey nfl 5 cleveland browns rush drift fashion</a> <a href="http://www.chachiscoffee.com/white-sox-21-welington-castillo-camo-realtree-collection-cool-base-stitched-mlb-jersey-nflw">white sox 21 welington castillo camo realtree collection cool base stitched mlb jersey</a> <a href="http://www.flypiip.com/air-max-1-essential-grau-mist-schuheg">air max 1 essential grau mist</a>
virginiaflyin http://www.virginiaflyin.com/
pandrosos
2019-01-04 14:46
<a href="http://www.ehomeoclinic.com/nfl-telvin-smith-womens-ash-50-jacksonville-jaguars-nike-backer-t-shirt-nflw">nfl telvin smith womens ash 50 jacksonville jaguars nike backer t shirt</a> <a href="http://www.geuwompo.com/dortmund-6-bender-home-long-sleeves-soccer-club-jersey-nflx">dortmund 6 bender home long sleeves soccer club jersey</a> <a href="http://www.inckua.com/noir-blanc-and-rouge-jordan-1-kurpesa">noir blanc and rouge jordan 1</a> <a href="http://www.infantocursos.com/nike-kyrie-1-brotherhood-lyon-azul-negro-anthracite-mettodasic-plata-butyf">nike kyrie 1 brotherhood lyon azul negro anthracite mettodasic plata</a> <a href="http://www.omegaspark.com/royals-30-yordano-ventura-grey-road-cool-base-stitched-mlb-jersey-nflw">royals 30 yordano ventura grey road cool base stitched mlb jersey</a> <a href="http://www.radsportland.com/nike-air-max-95-herre-bl%C3%A5-butyd">nike air max 95 herre bl氓</a>
pandrosos http://www.pandrosos.com/
bambubaits
2018-12-30 21:41
<a href="http://www.bealfrance.com/nike-lunarglide-6-oro-argento-scarpeb">nike lunarglide 6 oro argento</a> <a href="http://www.brooklyngay.com/sean-lee-autographed-jersey-nfls">sean lee autographed jersey</a> <a href="http://www.demointegrate.com/adidas-prossoator-headband-april-fool-day-scarpeg">adidas prossoator headband april fool day</a> <a href="http://www.diggingwp.com/buty-air-jordan-4-retro-brot-obuvc">buty air jordan 4 retro brot</a> <a href="http://www.frankiesvoice.com/nike-lebron-13-low-sort-infrar%C3%B8d-scarpea">nike lebron 13 low sort infrar酶d</a> <a href="http://www.hunnyblu.com/air-jordan-b-mo-violet-rose-schuheb">air jordan b mo violet rose</a>
[url=http://www.bambubaits.com/]bambubaits[/url]
shanamorgan
2018-12-30 19:05
<a href="http://www.ntygadget.com/roshe-run-sort-hvid-gr%C3%A5-scarpec">roshe run sort hvid gr氓</a> <a href="http://www.purchasetulsa.com/nike-mujeres-free-4.0-flyknit-corriendo-zapatilla-de-deporte-gris-kurpesc">nike mujeres free 4.0 flyknit corriendo zapatilla de deporte gris</a> <a href="http://www.pennywave.com/oakley-polarized-sunglasses-cleaning-zip-code-sunglassesg">oakley polarized sunglasses cleaning zip code</a> <a href="http://www.scoptix.com/mens-avonte-maddox-elite-midnight-green-nike-jersey-nfl-philadelphia-eagles-29-home-vapor-untouchable-nflr">mens avonte maddox elite midnight green nike jersey nfl philadelphia eagles 29 home vapor untouchable</a> <a href="http://www.domodrzwi.com/air-max-1-sport-blue-sale-skoa">air max 1 sport blue sale</a> <a href="http://www.magneticduo.com/kd-7-global-game-july-4th-sneakerf">kd 7 global game july 4th</a>
shanamorgan http://www.shanamorgan.com/

发表评论:

Powered by emlog 冀ICP备13011830号-1