자바스크립트 배열 활용(for) + 대문자로 출력
JS

자바스크립트 배열 활용(for) + 대문자로 출력

by nocagklhw 2020. 1. 17.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function get_members() {
            return ['abcd','efg','hijk','lmn'];
        }
        members = get_members();

        for(var i =0; i< 4; i++) {
            document.write(members[i].toUpperCase()+"<br/>");
        }
    </script>
</body>
</html>

댓글


TOP

TEL. 02.1234.5678 / 경기 성남시 분당구 판교역로