The molecules of onion and pineapple are bigger than formaldehyde, which can "cover up" the smell but can't really absorb formaldehyde. In fact, it only reduces the smell of formaldehyde, but formaldehyde is still volatile. At the same time, the smell produced by pineapple and onion will also react with formaldehyde, which may cause other harm to human body.
If you want to get rid of the odor or formaldehyde smell in the room early, it is recommended to open the window for ventilation so that the indoor air can be fully circulated; At the same time, you can also put some potted plants such as green radish and chlorophytum to purify the air; You can also buy some activated carbon to adsorb formaldehyde, but you should pay attention to regular ventilation and exposure to the sun.