This is a simple example for creating your first game in web assembly. The logic for this tic-tac-toe game is written in C++.
Download and Install Emscripten
https://emscripten.org/docs/getting_started/downloads.html
emcc --bind -o tic_tac_toe.js tic_tac_toe.cpp