{"id":40064,"student_id":208,"content":"/*****************************************************\n 練習一\n*****************************************************/\nvar arr = [3, 6, 2, 8, 1, 5, 0, 7, 9, 4];\n\nconsole.log('排序後:' + arr);\narr.sort(function (a, b) {\n return a - b;\n});\nconsole.log('排序前:' + arr);\n\n\n\n/***********************\n 練習二\n*****************************************************/\n// 目標:將年紀從小排到大並印出\nvar students = [\n { name: '大衛', age: 24 },\n { name: '莉莉', age: 17 },\n { name: '艾蓮', age: 18 },\n { name: '阿伯', age: 30 },\n { name: '威廉', age: 23 },\n { name: '凱文', age: 15 },\n { name: '朵莉絲', age: 22 }\n];\n\nstudents.sort(function(a,b) {\n return a.age - b.age;\n})\n\n// 印出完整物件\n console.log('排序後:' + JSON.stringify(students, null, 4));\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ","created_at":"2018-08-26T11:21:13.243+08:00","updated_at":"2019-11-10T19:22:03.621+08:00","name":"內建排序練習 副本","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/40064/fd1ac05835b665cf0d7e3c5532c7c2d7.jpg"},"parent_id":31717,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":64,"hashid":"882sjdpp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":706697,"file_name":"1.wav","project_id":40064,"asset_id":10,"created_at":"2018-08-26T11:21:13.250+08:00","updated_at":"2018-08-26T11:21:13.250+08:00"},{"id":706698,"file_name":"0.wav","project_id":40064,"asset_id":9,"created_at":"2018-08-26T11:21:13.251+08:00","updated_at":"2018-08-26T11:21:13.251+08:00"},{"id":706699,"file_name":"2.png","project_id":40064,"asset_id":8,"created_at":"2018-08-26T11:21:13.252+08:00","updated_at":"2018-08-26T11:21:13.252+08:00"},{"id":706700,"file_name":"1.svg","project_id":40064,"asset_id":7,"created_at":"2018-08-26T11:21:13.254+08:00","updated_at":"2018-08-26T11:21:13.254+08:00"},{"id":706701,"file_name":"0.png","project_id":40064,"asset_id":6,"created_at":"2018-08-26T11:21:13.255+08:00","updated_at":"2018-08-26T11:21:13.255+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦