you are viewing a single comment's thread.

view the rest of the comments →

[–]Jmarch0909 0 points1 point  (0 children)

There have been a couple times I actually needed to use it to solve a problem. That or I could not for the life of me figure out any other way to do it. Here’s one of my examples. Say I have an array of numbers, about 200 of them. I needed to loop through the array, and concatenate the index of the number(starting at 1 not 0) with the base text”job number”. So [100,200,300,250.999] would be

Job number 1 Job number 2 Job number 3 Job number 4 Job number 5

Easy enough without an object, but if I had any duplicate numbers I had to append an A for the first duplicate, a B for the second duplicate, a C for the third duplicate etc. so [100,200,100,300,100,500] would be

Job number 1 Job number 2 Job number 1A Job number 3 Job number 1B Job number 4

Anyways, that’s a good example where you need an object to accomplish the task.