learnjs icon indicating copy to clipboard operation
learnjs copied to clipboard

08. 반복문 · GitBook

Open utterances-bot opened this issue 4 years ago • 22 comments

08. 반복문 · GitBook

https://learnjs.vlpt.us/basics/08-loop.html

utterances-bot avatar Dec 07 '20 13:12 utterances-bot

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));

IngEoGeoBuk avatar Dec 07 '20 13:12 IngEoGeoBuk

function biggerThanThree(numbers) { return numbers.filter((number) => number > 3); }

QyujinLee avatar Mar 03 '21 01:03 QyujinLee

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;

WaterMinCho avatar Apr 22 '21 05:04 WaterMinCho

function biggerThanThree(numbers) { const a = []; for (let i = 0; i < numbers.length; i++) { if (i < 3) continue; a.push(numbers[i]); } return a; }

meichoi avatar May 13 '21 00:05 meichoi

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]

SeungWookHan avatar Jul 07 '21 17:07 SeungWookHan

function biggerThanThree(numbers) { let result = []; for (let i = 0; i < numbers.length; i++) { if(numbers[i] > 3) { result.push(numbers[i]); } } return result; }

AppleCEO avatar Jul 12 '21 15:07 AppleCEO

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));

kyhyun avatar Sep 01 '21 04:09 kyhyun

function biggerThanThree(numbers) { let big = []; for (let i = 0; i < numbers.length; i++) { if (numbers[i] > 3) { big.push(numbers[i]); } } return big; }

granen32 avatar Sep 16 '21 03:09 granen32

  function biggerThanThree(numbers) {
    let array = [];
    for (let key in numbers) {
      if (numbers[key] > 3) {
        array.push(numbers[key]);
      }
    }
    return array;
  }

gum4019 avatar Oct 15 '21 08:10 gum4019

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;

Jibros avatar Mar 22 '22 05:03 Jibros

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;

zuzubibi avatar Mar 23 '22 02:03 zuzubibi

22.05.24

codelua83 avatar May 24 '22 05:05 codelua83

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));

neoseurae12 avatar Aug 19 '22 07:08 neoseurae12

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));

jaehawilly avatar Nov 09 '22 12:11 jaehawilly

230308

DANU011 avatar Mar 08 '23 04:03 DANU011

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]

hongyeollee avatar Apr 25 '23 16:04 hongyeollee

/숫자로 이루어진 배열이 주어졌을 때, 해당 숫자 배열안에 들어있는 숫자 중 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;

GitMume avatar Sep 01 '23 05:09 GitMume

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));

Habyeok avatar Oct 22 '23 07:10 Habyeok

function biggerThanThree(numbers) { return Object.values(numbers).filter(no => no > 3); }

const numbers = [1, 2, 3, 4, 5, 6, 7]; console.log(biggerThanThree(numbers));

chosign avatar Nov 30 '23 00:11 chosign

231209

hdgpaul avatar Dec 09 '23 13:12 hdgpaul

240118

Joinwoo avatar Jan 18 '24 01:01 Joinwoo

240621

daeunkim99 avatar Jun 21 '24 04:06 daeunkim99