In this part of the pugjs tutorial series we will learn about differnt types of variables available in pug.
There are 4 types of data available in pug which can be stored in pug variables which are explained below :
String
value as shown below :
//example - 1
var str = "String";
//example - 2
var value = 'This is string type of data' ;
Integer
value as shown below :
//example - 1
var value = 25
//example - 2
var num = 2.57 ;
Array
values as shown below :
//example - 1
var arr = ['A', 'B', 'C']
object
values as shown below :
//example - 1
var obj= = { website: 'nodejsera.com' }
//example - 2
var value = {
field: 'web development' ,
type : 'education'
}
object
values as shown below :
var value = 'World' ;
var cnct = 'Hello' + value;
In this article we learned about the basics of variables in pugjs.