javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)

javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)

ID:41989340

大小:81.50 KB

页数:15页

时间:2019-09-05

javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)_第1页
javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)_第2页
javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)_第3页
javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)_第4页
javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)_第5页
资源描述:

《javascript常用函数集(常规函数、数组函数、日期函数、数学函数、字符串函数)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、javascript常用函数集(常规函数.数组函数、日期函数、数学函数、字符串函数)JavaScriptprovidesmanyfunctionsfordeveloperstouse,andhereisabriefintroduction,moredetailedinformation,refertotheonlinehelpprovidedbyVisualIntcrDcv.JavaScriptfunctionscanbedividedintofivecategories:conventionalfunctions,arrayfunctions,datefunct

2、ions,mathematicalfunctions,stringfunctions・1,regularfunctionTheJavaScriptroutinefunctionconsistsofthefollowing9functions:(1)alertfunction:displaysawarningdialogbox,includingaOKbutton.(2)confirmfunction:displaysaconfirmationdialog,includingtheOKandCancelbuttons・(3)escapefunction:conver

3、tscharactersintoUnicodccodes・(4)Evalfunction:calculatingtheresultofanexpression.(5)isNaNfunction:thetestis(true),no(false)isnotanumber・(6)parseFloatfunction:convertsstringsintocharacternumbers・(1)parselntfunction:convertsstringsintointegernumbers(whichcanbespecifiedinhexadecimalnumber

4、s)・(2)promptfunction:displaysaninputdialogboxthatpromptsforuserinput・Suchas:Script>(3)theunescapefunctiondecodesthecharactersencodedbytheescapefunction.1,arrayfunctionTheJavaScript

5、arrayfunctionconsistsofthefollowing4functions:(1)joinfunction:convertandcormectallelementsinanarraytoastring.Cases:Function,JoinDemo()VaR,a,b;A二new,Array(0,1,2,3,4);B=a・join(〃-“);//delimiterReturn(b);//returnb=0-1-2-3-4〃}Cases:(1)lengthfunction:returnsthelengthofthearray.Function,Leng

6、thDemo(){VaR,a,1;A二new,Array(0,1,2,3,4):L二a・length;Return(L);//1=5(2)reversefunction:invertthearrayelementsinreverseorder・Cases:Function,ReverseDemo(){VaR,a,1;A二new,Array(0,1,2,3,4);L=a・reverse();Return(L);}(1)sortfunction:reorderthearrayelements・Cases:Function,SortDemo(){VaR,a,1;A二ne

7、w,Array(〃X〃,〃Y〃,〃d〃,,〃厂,〃nT,〃R〃);L=a.sort();Return(L);1,datefunctionTheJavaScriptdatefunctionconsistsofthefollowing20functions:(1)getDatefunction:thedatevalueofthereturndate,whichis1'31.Cases:Function,DateDemo(){VaR,D,s二"Today's,date,is:〃〃;D二new,Date();S二(d.getMonth)(+1)+〃/〃;S二d.getDa

8、te(+)

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。