dump imports search path - (for)

主要範例

原始碼

#!/usr/bin/gjs

let list = imports.searchPath;
let len = list.length;
for (let key=0; key<len; key++) {
    let item = list[key];
    print('Key: ', key);
    print('Item: ', item);
    print('List: ', list);
    print('\n===============\n');
}

function 版

原始碼

#!/usr/bin/gjs

function dump_format_imports_search_path(list) {
    let len = list.length;
    for (let key=0; key<len; key++) {
        let item = list[key];
        print('Key: ', key);
        print('Item: ', item);
        print('List: ', list);
        print('\n===============\n');
    }
}

function dump_imports_search_path() {
    dump_format_imports_search_path(imports.searchPath);
}


dump_imports_search_path();