dump imports search path - (foreach)

主要範例

原始碼

#!/usr/bin/gjs

imports.searchPath.forEach(function(item, key, list) {
    print("Key: ", key);
    print("Item: ", item);
    print("List: ", list);
    print("\n============\n");
});

function 版

原始碼

#!/usr/bin/gjs

function dump_format_imports_search_path(list) {
    list.forEach(function(item, key, list) {
        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();