DALLAS — LeBron James faced the crowd and sidestepped his way up the floor after a punctuating 3-pointer in overtime made possible by Danny Green’s buzzer-beating 3 in regulation.

The Lakers star took an extra peek toward the national TV crew at center court, perhaps to gauge the entertainment value of the first matchup of the 15-time All-Star alongside Anthony Davis against Dallas’ young European pair of Luka Doncic and Kristaps Porzingis.

The extra period was anticlimactic — but didn’t really take away from the second half that preceded it.

Davis started overtime with back-to-back dunks after Green’s corner 3, and the Lakers beat the Mavericks 119-110 on Friday night amid matching triple-doubles from James and Doncic, the Slovenian who grew up admiring the four-time MVP.

“You never know who you can inspire along your path,” James said. “For me, playing the game the right way, getting my teammates involved and playing for the purity of the game, I was able to inspire a kid that wasn’t even in America. That’s pretty special.”

James had a season-high 39 points with 16 assists and 10 rebounds, while Doncic finished with 31 points, a career-high 15 assists and 13 boards.

According to the NBA, they became the youngest and oldest players in NBA history with triple-doubles that included at least 30 points and 15 assists, doing so in the same game.

The 20-year-old Doncic, who grew up modeling his game after James, had his 10th career triple-double, extending his record for the most for a player under 21. James, who has 82 for his career, is third on that list with five.

James had nine points in overtime, starting with a three-point play that followed Davis’ dunks for a second 10-0 run going back to regulation — following one that immediately wiped out a 10-point halftime lead to start the third quarter.

The last of Doncic’s assists went to Dorian Finney-Smith for a go-ahead 3-pointer in the final minute of regulation. The Mavericks got a stop, but Dwight Powell missed one of two free throws to keep their lead at three, setting up Green’s tying corner 3 on James’ 14th assist.

The Mavericks had a foul to give when James dribbled inside the 3-point line before finding Green.

“That’s on me,” coach Rick Carlisle said. “Our plan in that situation was to foul a guy on the catch in a non-shooting situation. But the fact that we were unable to do it is on me.”

Davis had 31 points and eight rebounds. Kristaps Porzingis finished with 16 points and nine boards after a fast start for the 7-foot-3 Latvian that included a crossover dribble 3-pointer in front of Davis in the best test yet of opposing big-name duos for him and Doncic.

Doncic had his triple-double before the end of the third quarter, helping the Mavericks restore all but one point of a 10-point halftime lead after the Lakers put together a 10-0 run coming out of halftime.

“You can’t watch this game and say the NBA isn’t one of the most enjoyable things to watch in the world,” Carlisle said. “We’re not happy about losing. That’s all.”

The Mavericks expanded a nine-point lead to 11 in the first half despite being without Doncic and Porzingis for nearly a full quarter because of foul trouble.

Part of the reason was the season debut of 7-foot-4 (formerly 7-3) Boban Marjanovic, who had four points and seven rebounds along with three fouls in 11 minutes.