Complete the code to check the installed Node.js version.
const version = process.[1];
console.log(`Node.js version: ${version}`);The process.version property returns the Node.js version as a string.
Complete the command to check Node.js version in terminal.
node [1]The node --version command prints the installed Node.js version in the terminal.
Fix the error in this Node.js script that prints version.
console.log('Node.js version:', process.[1]);
The correct property is process.version. Others do not exist or are incorrect.
Fill both blanks to create a script that checks if Node.js version starts with 'v14'.
if (process.[1].[2]('v14')) { console.log('Node.js version is 14.x'); }
process.version gives the version string, and startsWith('v14') checks if it begins with 'v14'.
Fill all three blanks to create a script that extracts major Node.js version number as an integer.
const versionString = process.[1]; const majorVersion = parseInt(versionString.[2](1, versionString.[3]('.', 1))); console.log(`Major version: ${majorVersion}`);
process.version gives the version string like 'v14.17.0'. slice(1) removes the 'v'. indexOf('.') finds the first dot to extract the major version number.