{"id":204014,"student_id":3439,"content":"var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\nshuffle(arr); // 將資料隨機打亂\nconsole.log(arr);\n\narr.sort(compare_asc);\nconsole.log(arr);\n\n// 由低到高排序\nfunction compare_asc (a, b) {\nreturn a - b; \n}\n\n// 由高到低排序\nfunction compare_desc (a, b) {\nreturn b - a; \n}\n\n\n\n","created_at":"2020-11-14T13:41:31.381+08:00","updated_at":"2020-11-14T13:50:36.805+08:00","name":"內建排序練習(1)預設版 副本","language":"javascript","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/204014/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":148158,"plugin":"function shuffle (arr) {\n for (var i=0; i\u003c1000; i++) {\n var rand1 = Math.floor(Math.random()*arr.length);\n var rand2 = Math.floor(Math.random()*arr.length);\n var tmp1 = arr[rand1];\n var tmp2 = arr[rand2];\n arr[rand1] = tmp2;\n arr[rand2] = tmp1;\n }\n return arr;\n}","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":63,"hashid":"qmds88kpz","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3529871,"file_name":"Gymnopedie_No_1.mp3","project_id":204014,"asset_id":212456,"created_at":"2020-11-14T13:41:31.388+08:00","updated_at":"2020-11-14T13:41:31.388+08:00"},{"id":3529872,"file_name":"koding.png","project_id":204014,"asset_id":212455,"created_at":"2020-11-14T13:41:31.390+08:00","updated_at":"2020-11-14T13:41:31.390+08:00"},{"id":3529873,"file_name":"space_bg.jpg","project_id":204014,"asset_id":212454,"created_at":"2020-11-14T13:41:31.391+08:00","updated_at":"2020-11-14T13:41:31.391+08:00"},{"id":3529874,"file_name":"earth.png","project_id":204014,"asset_id":212453,"created_at":"2020-11-14T13:41:31.392+08:00","updated_at":"2020-11-14T13:41:31.392+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦