Last active
August 29, 2015 13:56
-
-
Save igmarin/9242412 to your computer and use it in GitHub Desktop.
first_exercise.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//my variables to test | |
var preferred_code_sets = ['set', 'first', 'code', 'a']; | |
var codes_attribute = {'set': 1, 'dos': 3, 'a': 4}; | |
function codes_attribute(){ | |
{'set': 1, 'dos': 3, 'a': 4}; | |
} | |
function preferred_code(preferred_code_sets, codes_attribute, value_set_map=null){ | |
var code_value = function(code_attributes){try { | |
if (codes_attribute == null) { | |
codes_attribute = "codes" | |
} | |
if (value_set_map == null) { | |
value_set_map = nil | |
}; | |
}}; | |
//Working on another file the loop to do the check for elements on the array for preferred_code_sets and value_set_map | |
var matching_code_sets = new Array(); | |
for (var i = 0, l = preferred_code_sets.length; i < l; i ++) { | |
for(var index in codes_attribute){ | |
if(preferred_code_sets[i] == codes_attribute[index]){ | |
matching_code_sets.push(codes_attribute[index]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment