{"size": 443, "ext": "js", "max_stars_repo_path": "algorithm/bubbleSort/b.js", "max_stars_repo_name": "dingchaofa/notes", "max_stars_repo_stars_event_min_datetime": "2020-12-08T08:13:56.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-18T12:20:56.000Z", "max_issues_repo_path": "algorithm/bubbleSort/b.js", "max_issues_repo_name": "dingchaofa/notes", "max_issues_repo_issues_event_min_datetime": "2020-11-10T04:29:11.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T04:02:13.000Z", "max_forks_repo_path": "algorithm/bubbleSort/b.js", "max_forks_repo_name": "dingchaofa/notes", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 6, "max_issues_count": 26, "max_forks_count": null, "avg_line_length": 24.6111111111, "max_line_length": 58, "alphanum_fraction": 0.4243792325}
function BubbleSort(arr) {
    if (!(arr instanceof Array)) return "arr is not array"
    for (let i = 0; i < arr.length - 1; i++) {
        for (let j = 0; j < arr.length - i - 1; j++) {
            if (arr[j] > arr[j + 1]) {
                const tmp = arr[j]
                arr[j] = arr[j + 1]
                arr[j + 1] = tmp
            }
        }
    }
    return arr
}

let arr = [2, 4, 6, 5, 3, 1, 100]

console.log(BubbleSort(arr))
