I understand that bixby studio supports es6.
so I used for of
when writing the loop
but I got the following error
ERROR missing ; after for-loop initializer
Please let me know what is wrong.
// email
if (contactInfo.emailInfos) {
for (let emailInfo of contactInfo.emailInfos) { // <-- error is here
if (emailInfo && emailInfo.address
&& emailInfo.address.replace(/ /gi, '').toLowerCase().indexOf(keyword) > -1) {
contactInfo.subText = emailInfo.address;
return contactInfo;
}
}
}
dummy data
contactInfo = {
nameInfo: {
structuredName: 'James'
},
phoneInfos: [
{ number: '1234', phoneType: 'Home' },
{ number: '3456', phoneType: 'Work' }
],
emailInfos: [
{ address: 'address1@email.com', emailType: 'Home' },
{ address: 'address2@email.com', emailType: 'Work' }
]
}