{"id":206158,"student_id":1998,"content":"var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\nshuffle(arr); // 將資料隨機打亂\nconsole.log(arr)\narr.sort(compare_asc)\n console.log(arr)\n// 由低到高排序\nfunction compare_asc (a, b) {\n return a-b\n\n}\n\n// 由高到低排序\nfunction compare_desc (a, b) {\n return b-a\n}\n\n\n\n","created_at":"2020-11-21T16:13:10.113+08:00","updated_at":"2021-03-01T14:00:09.371+08:00","name":"內建排序練習(1)預設版 副本","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/206158/fd1ac05835b665cf0d7e3c5532c7c2d7.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":32,"hashid":"ej9s225p2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3579819,"file_name":"Gymnopedie_No_1.mp3","project_id":206158,"asset_id":212456,"created_at":"2020-11-21T16:13:10.120+08:00","updated_at":"2020-11-21T16:13:10.120+08:00"},{"id":3579820,"file_name":"koding.png","project_id":206158,"asset_id":212455,"created_at":"2020-11-21T16:13:10.122+08:00","updated_at":"2020-11-21T16:13:10.122+08:00"},{"id":3579821,"file_name":"space_bg.jpg","project_id":206158,"asset_id":212454,"created_at":"2020-11-21T16:13:10.123+08:00","updated_at":"2020-11-21T16:13:10.123+08:00"},{"id":3579822,"file_name":"earth.png","project_id":206158,"asset_id":212453,"created_at":"2020-11-21T16:13:10.125+08:00","updated_at":"2020-11-21T16:13:10.125+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦