Check out example codes for "c# get os version". It will help you in understanding the concepts better.
Code Example 1
// Save the OS info to an variable
OperatingSystem os = Environment.OSVersion;
// Print the OS info to the console
Console.WriteLine($"platform: {os.Platform}\n" +
$"version: {os.Version}\n" +
$"version string: {os.VersionString}");
Learn ReactJs, React Native from akashmittal.com