There are a few things worth keeping in mind, as a rule of thumb, when picking a shampoo or soap or hand-cream or whatever off a shop shelf.
The usual thing that spoils a product is mould or fungus, so whatever they put in it has to be good enough to kill that. However, moulds and fungi are some of the most resilient organisms known and it's rare for a substance to kill a fungus, for example, but not harm a human. But increasing shelf-life of goods helps the product manufacture and the shop, but not YOU (except they can drive the price down).
J&J might be removing formaldehyde from their baby shampoo, but other substances, like benzoic acid (sodium benzoate) isothiazolinone, artificial fragrances and a heap of others are to be found in most shampoos, conditioners, and hand-soaps, except usually "organic" labels. These substances are known to cause cancer, or nerve damage, or promote allergy, and should be avoided when possible, but are very hard to avoid.
The problem doesn't stop there, however, as the plastic bottles which you drink from, the polar-fleece you wear, even the ink on plastic wrapping of food contain substances that mimic hormones (mostly estrogen) and can harm fertility and affect personality. They probably promote some types of cancer too.
Organic products are not a guarantee of safety either. Eucalyptus products (like Teatree oil) for example contain toxins which can cause cancer.
But the laws governing what you put on your skin are not the same as those for what you put in your mouth, yet try smearing garlic paste on your feet and notice how the taste of garlic soon appears in your mouth. Everything you touch is absorbed to some extent through the skin. Finding reaserch on harmful effects of lesser known substances is often difficult as it often doesn't even get published, or never gets beyond animal studies.
So in summary, my practice is to research which products are clear to use, and just stick to them, regardless of what the price difference is. We have never used J&J shampoo for our kids, but have instead gone for organic shampoos.