In the new book “Fantasyland: How America Went Haywire” (Random House), writer Kurt Andersen explores the many curious ways in which Americans seem determined to delude ourselves, and always have. (The book’s waggish subtitle is “A 500-Year History.”)

“Not so long ago,” recalls the baby-boomer author, “American adults never dressed up in costumes, certainly not as an annual ritual. When my daughters reached their early 20s, obsessing more than ever over their Halloween costumes, they were shocked when I told them that.”

Andersen adds that “in the 1980s, after the Halloween parades invented by freshly out gay people in San Francisco and New York, dressing up on Halloween became a thing straight adults did in every corner of the country.”

Every corner? Now it’s happening in every other house. This year, 48 percent of American adults plan to wear a Halloween costume, according to the National Retail Federation, which says that 2017’s spooky-season spending will hit an all-time high of $9.1 billion, or $86 per household. Sixteen percent — that’s 50 million people — plan to put a costume on their pet.

In other words, we’re just a year or two away from a majority of our nation’s adults playing kiddie dress-up.

Halloween is blowing up because childhood is leaking further and further into adult life, and millennials in particular aren’t fully sold on the idea that they’re grown-ups. Candy? Costumes? Silly pranks? These things should gradually start losing interest for you about the time you learn what a 401(k) is. Instead, childish behavior is losing all connotations of being embarrassing.

Video games — sales of which hit an all-time high of $30.6 billion last year — as well as the increasing popularity of cosplay (dressing up in costumes the other 364 days of the year), comic-book conventions, superhero movies and fantasy sports are all symptoms of what Andersen dubs “Kids ‘R’ Us Syndrome”: We’re losing our collective sense of when it’s time to put away childish things.

Halloween is simply the night when it’s most socially acceptable to act 11. Or dress up like Eleven, the telekinetic girl from “Stranger Things.” Halloween is also an intensely visual holiday, which means it appeals to the millennial obsession with broadcasting to the world everything they do on Instagram and YouTube. The effort it takes to put on makeup and costumes gets leveraged and rewarded with the potential for online attention: Click or treat! Actually, the click is the treat, sweeter than candy corn.

The absence of kids from millennials’ lives enables them to keep pretending they’re children themselves.

Millennials (roughly speaking, 18- to 35-year-olds) have more freedom and more choices than previous generations, which is great in theory but has also left them feeling overwhelmed with options. A LinkedIn survey found that millennials hold an average of three jobs in the first five years after college, nearly double the rate of job-hopping of the previous generation.

Getting used to having lots of options leads to a kind of lifetime channel-flicker syndrome — a reluctance, or inability, to pick just one thing. As recently as the 1970s, 80 percent of Americans were married by the time they were 30, but millennials can’t pick a partner to settle down with nor commit to having kids. According to a US Census Bureau report, among those in the 25-34 age range as of 2016, fewer than one-quarter had completed the big four adult benchmarks: living apart from parents and having a job, a spouse and one or more kids.

Being financially attached to one’s folks, or living in Mom’s basement, bolsters a 30-year-old’s illusion that he’s still a kid. As of 2015, only 41 percent of adults aged 25 to 34 were living apart from their parents and without financial assistance from them. That’s down substantially from 51 percent in 2005 and way down from previous generations.

One of the leading causes of maturity is having children: Nothing puts the gray hairs in the scalp as rapidly as trying to foil your toddlers’ incessant attempts to hurt themselves, and nothing makes grown-up pursuits so inviting as spending the day crawling around on the rug playing My Little Pony.

The absence of kids from millennials’ lives enables them to keep pretending they’re children themselves. A hipster in Richard Price’s 2009 novel “Lush Life” is asked, “All those tattoos, what are you gonna tell your kids?” The guy replies, “My kids? I’m my own kid!”

Yet despite being their own kids, millennials turn out to be the most stressed-out generation, according to an American Psychological Association survey. Indeed, this generation’s anthem is “Stressed Out” by Twenty One Pilots. Which in turn leads them back to needing some way to distract themselves from their gloom: Hey, what better way to do that than to dress up as the Grim Reaper?