0
In a beginner in javascript can you please help ?
1)Create an object with two attributes name and email, which have your name(format:first.last) and email address respectively. And then assign the object to a variable called myInfo. 2)Write a function with the name checkEmail, which accept a string as argument and return a boolean to represent if the string contains the character '@'. 3)Call the function checkEmail with the email argument of myInfo and assign the return value to a variable called hasValidEmail. 4)Write another function
6 ответов
+ 2
So, what have you already tried so far? Where are you at and what errors are you getting?
Post your code to the Code Playground and I'll happily help guide you on it.
+ 2
At the very top of this website, put your code in the Code Playground and save it. Afterward, copy/paste the URL to me. That'll let me access it, see the errors, fix/comment on it, and then send it back to you so you can study it.
0
var myinfo; myinfo={name: 'chuck.billy', email: 'chuckbilly@gmail.com'}; console.log(myinfo); function checkEmail(eMail) { var hasValidEmail = false; if (eMail.indexOf("@")>=0) { hasValidEmail = true; } return hasValidEmail; } function splitName(fullName) { return fullName.split('.'); } var firstName=splitName(myinfo.name)[0]; console.log(firstName); console.log(checkEmail(myinfo.email))
0
can you help cuz dnt know what to do from here it gives me error
0
netkos ent help m stuck