Steps to Create an EJS application
Step 1: Firstly, we will make the folder named root by using the below command in the VScode Terminal. After creation use the cd command to navigate to the newly created folder.
mkdir root
cd root
Step 2: Once the folder is been created, we will initialize NPM using the below command, this will give us the package.json file.
npm init -y
Step 3: Once the project is been initialized, we need to install Express and EJS dependencies in our project by using the below installation command of NPM.
npm i express ejs
<%= vs <%- in EJS Template Engine
EJS stands for Embeded JavaScript. It’s a simple templating language that lets you generate HTML with plain JavaScript. EJS allows you to embed JavaScript code directly into your HTML. It is often used directly in your HTML markup, making it easy to generate dynamic content.
In this article, we will discuss <%= and <%- in EJS, along with discussing significant differences that distinct them from each other.