One by one, the children at Public School 30 on Staten Island dumped their uneaten bananas into a bin in the back of their raucous cafeteria, each greenish-yellow missile landing with a thud. Thud. Thud.

John Sullivan, 9, a fourth grader, said bananas “make my stomach hurt.” Julianna Delloso, 6, a first grader, said “they taste funny.” And Joseph Incardone, 7, also in first grade, was almost gleeful as he explained why he, too, had chucked his unpeeled banana. “I didn’t like it,” he said.

The sad voyage of fruits and vegetables from lunch lady to landfill has frustrated parents, nutritionists and environmentalists for decades. Children are still as picky and wasteful as ever, but at least there is now a happier ending — that banana-filled bin is a composting container, part of a growing effort to shrink the mountains of perfectly good food being hauled away to trash heaps every year.

New York City’s school composting program, kicked off just two years ago by parents on the Upper West Side, is now in 230 school buildings in Manhattan, Brooklyn and Staten Island, and is expected to more than double in size and reach all five boroughs in the fall, with an ultimate goal of encompassing all 1,300-plus school buildings.