I'd take the 4.0. every. single. time.
The 3.8L V6 is garbage. Under powered, and has a reputation for drinking oil. There are many 3.8 Wrangler owners with less than 100k miles who add quarts of oil between changes. Early 3.8 wranglers often spun bearings. It has the power of a 4 cylinder with the fuel mileage of a V8. These models (2007-2011) don't hold their value as well either. There are 4.0 TJs that are much more expensive than newer JKs with the 3.8L.
The 3.6L V6 is worlds ahead in horsepower (285hp), but I feel the 4.0L has a better torque curve. The 3.6L really has to scream to get going, and when it does then it hauls. It makes most of it's power in the higher RPM range. This also has to do with the weight of the JK versus the earlier TJ models.
I want to like the newer Jeeps, but the quality isn't there in my opinion. I was considering a 3.6L Wrangler, but they do have their fare share of issues:
-Tops that leak like crazy on brand new Jeeps
-Manual transmissions that pop out of gear, and won't go into reverse
-Clutches that have issues right off the lot and aren't covered under warranty
-Stalling/no start issues with the 3.6
-Plastic oil coolers cracking, causing massive oil leaks
-Plastic oil filter housings on '12-'13 models loosing bypass springs
-Engine knocking and rod bearing failure on the 3.6
I didn't believe the last one, but a local tech at the dealership said he has seen quite a few 3.6 engines under 90k miles with thrown connecting rods, and the engine was "redesigned" for 2017. Not things that should be happening in a vehicle this new. If I was going to buy a Wrangler, I'd be more likely to buy a $10-15k TJ than a newer $30k JK with the potential issues.
I'm not saying they will all have these issues, but the ones who have dealt with these problems have had quite the experience.