If anyone invented the teenager and his cargo of self-pity, tortured reflection and nonspecific alienation, it was J.D. Salinger. Yet Salinger’s progeny, some twisted (Mark Chapman and John Hinckley, each of whom brought a copy of “The Catcher in the Rye” to their murder missions), some decadent (Bret Easton Ellis’s gang of loners in “Less than Zero”), some harmless (Judd Nelson in “The Breakfast Club,” Dave Eggers in “A Heartbreaking Work of Staggering Genius”) were phonies. Salinger didn’t suffer from nameless angst. His inner horrorshow was clearly labeled WWII.

“Zero” author Bret Easton Ellis, hours after Salinger’s death Wednesday, Tweeted, “Yeah!! Thank God he’s finally dead. I’ve been waiting for this day for-f – – – ing ever. Party tonight!” It was the longest prose passage by Ellis anyone had been able to finish in years. Maybe he was being sardonic. Who knows? With Salinger, you knew.

Salinger was the opposite of the glib ironists and achy poseurs who tried on Holden’s deerstalker cap. He was a genuinely tortured soul trying to work out some weary balance of love and squalor. Salinger (who met Hemingway after his 4th Infantry Division helped liberate Paris and corresponded with him) could have written something similar to “The Sun Also Rises” but never anything remotely as tricksy, cutesy and narcissistic as “A Heartbreaking Work of Staggering Genius.” Even Salinger’s most notoriously overwrought work — “Hapworth 16, 1924,” in which a supposedly 7-year-old Seymour Glass regales us with his tiresome genius — is childlike instead of childish.

What “The Real World” was to Eggers, the real world was to Salinger. He stormed Utah Beach on D-Day, fought in some of the most vicious battles of the European theater at Huertgen and the Bulge — then went to Dachau.

You don’t see any of this in his fiction? You’re not looking hard enough. Like his central character Seymour Glass, he suffered a mental breakdown in the war, and his most-discussed story, “A Perfect Day for Bananafish,” finished in 1946, concludes with Seymour’s mysterious suicide. Instead of suicide, Salinger chose self-exile. “You never really get the smell of burning flesh out of your nostrils,” Salinger once told his daughter. “No matter how long you live.”

I’m not the first to call Salinger a war writer (see biographer Ian Hamilton and The New Yorker’s Louis Menand) but that scent of roasted humanity is as pivotal to his writing as it is to Anne Frank’s.

In the uncollected short story, “The Last Day of the Last Furlough,” the hero, Babe, says, “I believe in killing Nazis and Fascists and Japs, because there’s no other way that I know of. But I believe, as I’ve never believed in anything else before, that it’s the moral duty of all the men who have fought and will fight in this war to keep our mouths shut, once it’s over, never again to mention it in any way.”

Salinger suffered from post-traumatic stress, his daughter maintained, and that condition gave his work its bleak depths.

If his imitators inflated a druggy Christmas break or an MTV audition or high-school detention into an epic, Salinger reduced D-Day to an amusing anecdote. “I was visiting Devonshire for my health,” the soldier in “For Esmé — with Love and Squalor” tells his new 13-year-old friend as he is preparing to invade France. She informs him (within the earshot of her small brother) that her father has been “s-l-a-i-n” in North Africa but hopes that the narrator survives the war “with all your faculties intact.” Later in the story, which skips from spring 1944 to post-V-E Day and from first to third person, the soldier allows tersely that “he had not come through the war with all his faculties intact.”

Salinger was a child before the war, a casualty after it, and his personal and professional life formed an obsessive quest to counter moral exhaustion and devastation with the youthful, the pure — the prewar. At 36, he married a 21-year-old, then in his 50s carried on an affair with then-Yale freshman Joyce Maynard. The reports of urine-drinking and fasting are manifestations of the same mania for purity.

His characters — whether at college, or summer camp, or in prep school — are outwardly representatives of young Salinger’s world, but inwardly they are wrecked and rearranged by what he saw in the war, and his reconciliation of the two speaks with a scarred beauty. Esmé’s soldier, for instance, while recovering from his breakdown, finds transcendence in the wristwatch she sends him. “Suddenly, almost ecstatically, he felt sleepy,” Salinger writes. “You take a really sleepy man, Esmé, and he always stands a chance of again becoming a man with all his fac — with all his f-a-c-u-l-t-i-e-s — intact.”