Im trying to add last to every i value that divides perfectly by 3, but I don’t want index 0 to be one of them. Can anyone tell me how I can use modulus on every 3rd item except the first?
((i%3==0) ? 'last' : '');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sometimes instead of trying to find a inclusive solution for your edge case, just be explicit and say you don’t want to include 0.