Skip to content

Instantly share code, notes, and snippets.

@kiknaio
Forked from anonymous/index.html
Last active January 8, 2017 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiknaio/c4da05a8cad147e3d1c57709551c21c7 to your computer and use it in GitHub Desktop.
Save kiknaio/c4da05a8cad147e3d1c57709551c21c7 to your computer and use it in GitHub Desktop.
FreeCodeCamp - Advanced challenge
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function sym(args) {
var total = [];
var numbers = [];
var filtered = [];
for(var i=0; i<arguments.length; i++) {
total.push(arguments[i]);
}
for(var l=0; l<total.length; l++) {
total[l].forEach(function(num) {
numbers.push(num);
});
}
// for(var m=0; m<number.length; m++) {
// if(filnumber[m])
// }
console.log(numbers.indexOf(10));
console.log(numbers);
}
sym([1, 2, 3], [5, 2, 1, 4]);
</script>
<script id="jsbin-source-javascript" type="text/javascript">function sym(args) {
var total = [];
var numbers = [];
var filtered = [];
for(var i=0; i<arguments.length; i++) {
total.push(arguments[i]);
}
for(var l=0; l<total.length; l++) {
total[l].forEach(function(num) {
numbers.push(num);
});
}
// for(var m=0; m<number.length; m++) {
// if(filnumber[m])
// }
console.log(numbers.indexOf(10));
console.log(numbers);
}
sym([1, 2, 3], [5, 2, 1, 4]);
</script></body>
</html>
function sym(args) {
var total = [];
var numbers = [];
var filtered = [];
for(var i=0; i<arguments.length; i++) {
total.push(arguments[i]);
}
for(var l=0; l<total.length; l++) {
total[l].forEach(function(num) {
numbers.push(num);
});
}
// for(var m=0; m<number.length; m++) {
// if(filnumber[m])
// }
console.log(numbers.indexOf(10));
console.log(numbers);
}
sym([1, 2, 3], [5, 2, 1, 4]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment