triplexlab
Version:
프론트엔드 개발자가 프로젝트할때 흔하고 많이 하는 작업들을 나만의 플러그인으로 만들었습니다.\ ES6의 class기반으로 만들었고, 공부하는 차원으로 만들었습니다.🧑🏻💻🧑🏻💻
30 lines (26 loc) • 1.22 kB
HTML
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="/dist/build.min.css">
<link type="text/css" rel="stylesheet" href="./app.css">
<title>여러가지 배열로된 data들을 하나의 배열로 통합</title>
</head>
<body>
<ul class="list-inner"></ul>
<ul class="list-inner2"></ul>
<script src="/dist/build.min.js"></script>
<script>
(function() {
const people = [ ['iPhone','iMac','macbook'], ['coke','diet coke'], ['americano','latte', 'tea2'] ];
const arr3 = [ ['IPhone'], ['Coke'], ['Diet Coke'], ['Americano','Latte', 'Tea3'] ];
// ((주의) 원본 배열의 데이터가 첫글자에서 대문자, 소문자를 통일 시켜줘야 내림차순 기능이 됩니다.)
const peoples = tr.dataArray(people) //dataArray는 여러가지 배열(2차배열)로된 data들을 하나의 배열로 통합시켜 내림차순으로 반환 해줍니다.
const arr3s = tr.dataArray(arr3)
console.log(peoples)
console.log(arr3s)
})();
</script>
</body>
</html>