Open utterances-bot opened 3 years ago
function biggerThanThree(numbers) { k = [] for (let number of numbers) { if(number > 3) { k.push(number) } }
return k }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers));
function biggerThanThree(numbers) { return numbers.filter((number) => number > 3); }
function biggerThanThree(numbers) { const p = []; for (let i = 0; i < numbers.length; i++) { if (numbers[i] > 3) p.push(numbers[i]); } return p; }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers)); // [4, 5, 6, 7]
export default biggerThanThree;
function biggerThanThree(numbers) { const a = []; for (let i = 0; i < numbers.length; i++) { if (i < 3) continue; a.push(numbers[i]); } return a; }
function biggerThanThree(numbers) { numbers = numbers.filter((number) => number > 3); return numbers; }
const numbers2 = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers2)); // [4, 5, 6, 7]
function biggerThanThree(numbers) { let result = []; for (let i = 0; i < numbers.length; i++) { if(numbers[i] > 3) { result.push(numbers[i]); } } return result; }
function thanThree(numbers){ let arr = []; for(let i = 0; i < numbers.length; i++){ if(numbers[i] > 3) { arr.push(numbers[i]); } } return arr;
}
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(thanThree(numbers));
function biggerThanThree(numbers) { let big = []; for (let i = 0; i < numbers.length; i++) { if (numbers[i] > 3) { big.push(numbers[i]); } } return big; }
function biggerThanThree(numbers) {
let array = [];
for (let key in numbers) {
if (numbers[key] > 3) {
array.push(numbers[key]);
}
}
return array;
}
function biggerThanThree(numbers) { const array = []; for (let i = 0; i < numbers.length; i++) { if (numbers[i] > 3) { array.push(numbers[i]); } } return array; }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers)); // [4, 5, 6, 7]
export default biggerThanThree;
function biggerThanThree(numbers) { / 구현해보세요 / const arr = []; for (let number of numbers){ if (number > 3){ console.log(number) arr.push(number); } } return arr; }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers)); // [4, 5, 6, 7]
export default biggerThanThree;
22.05.24
22.08.19
// 퀴즈 // 숫자로 이루어진 배열이 주어졌을 때, 해당 숫자 배열안에 들어있는 숫자 중 3보다 큰 숫자로만 이루어진 배열을 새로 만들어서 반환해보세요.
function bigger_3(numbers) { let result = [];
for (let num of numbers) { if (num > 3) { result.push(num); } }
return result; }
const nums = [1, 2, 3, 4, 5, 6, 7];
console.log(bigger_3(nums));
function biggerThanThree(numbers){ const result = []; for(let i=0;i<numbers.length;i++){ if(numbers[i]>3){ result.push(numbers[i]); } } return result; } const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers));
230308
const biggerThanThree =(numbers)=>{ let arr = []; for(let i=4; i<numbers.length+1; i++){ if(i>=4){ arr.push(i) } } return arr }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers))//[4,5,6,7]
/숫자로 이루어진 배열이 주어졌을 때, 해당 숫자 배열안에 들어있는 숫자 중 3보다 큰 숫자로만 이루어진 배열을 새로 만들어서 반환해보세요./
function biggerThanThree(numbers) { let arr=[]; for(let i=0;i<numbers.length;i++){ if(numbers[i]>3){ arr.push(numbers[i]); } } return arr; }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers)); // [4, 5, 6, 7]
export default biggerThanThree;
function biggerThanThree(numbers) { let addnum = []; for (let i = 0; i < numbers.length; i++) { if (i <= 2) continue; addnum.push(numbers[i]); } return addnum; }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers));
function biggerThanThree(numbers) { return Object.values(numbers).filter(no => no > 3); }
const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers));
231209
240118
240621
08. 반복문 · GitBook
https://learnjs.vlpt.us/basics/08-loop.html