const fruit_list = ['사과', '감', '감', '배', '포도', '포도',
'딸기', '포도', '감', '수박', '딸기'];
let count = 0;
fruit_list.map(fruit => {
if (fruit == '딸기') {
count += 1;
}
});
console.log(count);
//1. indexOf
const checkEmail = (email) => {
if (email.indexOf('@') !== -1) {
console.log('이메일입니다!')
}else{
console.log('이메일이 아닙니다!');}
};
checkEmail('stringgmail.com');
//2. 정규표현식