JSFiddle - React, Tailwind, and code Playground

JavaScript

var obj1 = {
	val1: 1,
  val2: 2
}

var obj2 = {
	val1: 1,
  val2: 2
}

if(obj1.val1 == obj2.val1) {
	alert('the values are the same')
} else {
	alert('the values are different')
}