function pickFrom(n, list) {
const copy = Array.from(list);
return Array.from(Array(n), () => copy.splice(Math.floor(copy.length * Math.random()), 1)[0]);
}
var quiz = [{
"question": "What is the full form of IP?",
"choices": ["Internet Provider", "Internet Port", "Internet Protocol"],
"correct": "Internet Protocol"
}, {
"question": "Who is the founder of Microsoft?",
"choices": ["Bill Gates", "Steve Jobs", "Steve Wozniak"],
"correct": "Bill Gates"
}, {
"question": "1 byte = ?",
"choices": ["8 bits", "64 bits", "1024 bits"],
"correct": "8 bits"
}, {
"question": "The C programming language was developed by?",
"choices": ["Brendan Eich", "Dennis Ritchie", "Guido van Rossum"],
"correct": "Dennis Ritchie"
}, {
"question": "What does CC mean in emails?",
"choices": ["Carbon Copy", "Creative Commons", "other"],
"correct": "Carbon Copy"
}, {
"question": "wsxwsxwsxwsxwsxwsx?",
"choices": ["wsx", "edc", "qaz"],
"correct": "wsx"
}, {
"question": "qazqazqazqazqazqaz?",
"choices": ["qaz", "wsx", "edc"],
"correct": "qaz"
}, {
"question": "asdasdasdasdasdasd?",
"choices": ["asd", "qwe", "zxc"],
"correct": "asd"
}, {
"question": "zxczxczxczxczxczxc?",
"choices": ["zxc", "asd", "qwe"],
"correct": "zxc"
}, {
"question": "qweqweqweqweqweqwe?",
"choices": ["qwe", "asd", "zxc"],
"correct": "qwe"
}];
console.log(pickFrom(3, quiz));