JavaScriptã§ä½ã£ãé åã®é çªãç¹å®ã®é çªã«å ¥ãæ¿ãããæããã£ãã®ã§ãã½ã¼ããã¦å ¥ãæ¿ããæ¹æ³ã調ã¹ã¾ããã sorté¢æ° ã½ã¼ãããé¢æ°ãç¨æããã¦ãã¾ãã®ã§ãsorté¢æ°ã使ãã¾ãããã©ã¡ã¼ã¿ã¼ãå ¥ããªãã¨ã¢ã«ãã¡ãããé ã«ãªãã¾ãã //é å var station = ["Shinjyuku","Ikebukuro","Shibuya","Ueno"] //é åãã½ã¼ã station.sort(); //åºåç¨ alert(station); // Ikebukuro,Shibuya,Shinjyuku,Ueno ã¡ãªã¿ã«é åã®ä¸èº«ãæ°åã®å ´åã ã¨ã»ã»ã» var number = [50000,40,900,3000] number.sort(); alert(number); // 3000,40,50000,900 ã¢ã«ãã¡ãããé ãªã®ã§ããã®ãããªä¸¦ã³ã«ãªãã¾ãã
{{#tags}}- {{label}}
{{/tags}}