The Islanders did not have to use much imagination to think of how much this would have hurt had they lost the game. It was staring them right in the face, and hitting them in the ears, what with some fans at Barclays Center booing after two periods.

At the end, though, the fans were chanting, “Yes! Yes! Yes!” and the Islanders were able to keep looking forward optimistically, not backward in regret. For the second game in a row, they showed they believe it’s never too late. As they had on Saturday in Carolina, they tied the Hurricanes in the third period and won it after regulation Tuesday night. This time, it was a 2-1 shootout win that kept momentum going and allowed them to say, “Whew.”

“Well, everyone starts to grip a little bit harder, but we know the importance of these games, we’re ready for them every night,” said Anders Lee, who tied it with a power-play goal at 12:08 of the third, holding his ground in front and tipping John Tavares’ blast past Cam Ward .

“Even though they had the first one tonight, we stayed with our game plan.”

They won it as Thomas Greiss stopped all three Hurricanes shots in the shootout and Kyle Okposo converted the Islanders’ first attempt. This all happened after Cal Clutterbuck scored in the third period and overtime Saturday, meaning that the Islanders might be developing a confident, clutch streak at just the right time.

$relatedItem.embed_code.value

“Confidence is everything in this sport. When you have it everything seems so easy out there. When you don’t . . . The only thing you can do is simplify your game,” said Frans Nielsen, who Tuesday night became only the 13th Islander to play in 600 games for the team. “It can hit your leg and it goes in and suddenly you’ve got confidence again. It’s a funny thing.”

advertisement | advertise on newsday

Their confidence would have taken a huge hit had they not bounced back from a goal at 18:31 of the second by 29-year-old rookie Derek Ryan, who signed as a free agent after years in Europe. Neither side had played an inspiring game before that. Nothing they did on the ice evoked a cheer to eclipse the video board tributes to Nielsen and Stan Fischler, who celebrated the 40th anniversary of his first game as analyst on an Islanders telecast.

But the Islanders got going in the third, taking advantage of the second of two power plays — created when Brett Pesce barreled into Greiss. “We skated and got more pucks to the net,” coach Jack Capuano said. “We knew it was coming.”

If so, he had one on just about everyone in the building. A loss sure seemed possible. “It would have been ugly. It would have been a tough loss,” Nielsen said. “But I liked how we didn’t panic there.”

As it is, the Islanders remained three points behind the Penguins for third place in the Metropolitan Division. “It’s going to come down the wire. We knew that,” Capuano said.

They went four up on the Red Wings in the wild card race, the same margin they are ahead of the Flyers.

Now the Islanders, 8-1-1 in their past 10 at home, can look forward to the next three games in Brooklyn. All told, it was a very good night for the Islanders. It could have been much worse.

How much? Said Lee, “I’m glad we don’t have to worry about that.”