mam cos takiego:
<!DOCTYPE html>
<html lang="pl">
<head>
</head>
<body>
<script>
var dictionary = [];
var test = [];
var word1 = {
baseWord: "angry",
translation: "zły",
baseKey: "pl",
targetKey: "en"
};
add (word1);
var word2 = {
baseWord: "happy",
translation: "szczęśliwy",
baseKey: "pl",
targetKey: "en"
};
add (word2);
var word3 = {
baseWord: "hate",
translation: "nienawiść",
baseKey: "pl",
targetKey: "en"
};
add (word3);
var word4 = {
baseWord: "bored",
translation: "znudzony",
baseKey: "pl",
targetKey: "en"
};
add (word4);
var word5 = {
baseWord: "excited",
translation: "podniecony",
baseKey: "pl",
targetKey: "en"
};
add (word5);
var word6 = {
baseWord: "love",
translation: "miłość",
baseKey: "pl",
targetKey: "en"
};
add (word6);
var word7 = {
baseWord: "sad",
translation: "smutny",
baseKey: "pl",
targetKey: "en"
};
add (word7);
var word8 = {
baseWord: "tired",
translation: "zmęczony",
baseKey: "pl",
targetKey: "en"
};
add (word8);
var word9 = {
baseWord: "scared",
translation: "przestraszony",
baseKey: "pl",
targetKey: "en"
};
add (word9);
var word10 = {
baseWord: "worried",
translation: "zmartwiony",
baseKey: "pl",
targetKey: "en"
};
add (word10);
remove(word9);
function add(word){
dictionary.push(word);
//test.push(word);
}
function remove (samolot){
dictionary.forEach(function (el,ind) {
if(el===samolot){
dictionary.splice(ind,1);
}
});
}
</script>
</body>
</html>
chciałbym zeby slowa byly losowaane...pomoze ktos? ;)