troubleshooting Question

jQuery Detect When Last Value is Found?

Avatar of MJ
MJFlag for United States of America asked on
JavaScriptjQuery
4 Comments1 Solution80 ViewsLast Modified:
How do I detect when the last value is found in the below function? I don't do jQuery!  What I want is to add a pipe delimiter after each value is found but not the last value. So I'd have for example if it returns 3 values then I will get ==> value1|value2|value3 . The example below uses a console.log but it will actually be returning the value in a variable, in real life.

 $(function() {
	        $('[class*="solid-shape-large-rating-"]').each(function(i, e) {
		        var result = this.className.match(/solid-shape-large-rating-(.*?)\s+/);
		        console.log(result[1]);
			    
	        });
       });
ASKER CERTIFIED SOLUTION
leakim971
Multitechnician
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros