Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialkayla hopwood
Front End Web Development Techdegree Student 570 Pointswhen I use console.count() it will not count all the characters. it just says 1.
var firstName = prompt('What is your first name?');
var lastName = prompt('What is your last name?');
var fullName = (firstName.toUpperCase() + " " + lastName.toUpperCase() );
alert(fullName);
console.count(fullName);
everything pops up the way it should but in the console it just shows the names capped but only counts as 1 character.
1 Answer
KRIS NIKOLAISEN
54,971 PointsMDN on console.count()
:
Logs the number of times that this particular call to count() has been called. This function takes an optional argument label.
If you want a character count you'd use fullName.length
Peter May
16,376 PointsPeter May
16,376 PointsI followed a similar path but used this instead.
https://w.trhou.se/4etkio35vp