Unable to compare string in if condition

Good morning all,

Can someone help me in resolving below issue?

From a Json response i am capturing product weight and type like quantity or weight"
When i am adding that item to basket the request changes for each type of product.
So i need to write a if condition like

if(producttype = weight){
var requestBodyAddToBasket="{“items”:[{“id”:""+v_c_ProductId+"",“newValue”:"+v_newValue+",“oldValue”:"+v_oldValue+",“newUnitChoice”:“pcs”,“oldUnitChoice”:“pcs”,“catchWeight”:"+v_c_maxWeightValue+"}],“loggedInAction”:“update-trolley-item”}"

var requestBodyAddToBasket="{“items”:[{“id”:""+v_c_ProductId+"",“newValue”:"+v_newValue+",“oldValue”:"+v_oldValue+",“newUnitChoice”:“pcs”,“oldUnitChoice”:“pcs”}],“loggedInAction”:“update-trolley-item”}"

I am getting below error…

type mismatch;
found : Unit
required: Boolean
if(v_c_displayType = Weight){

Can someone please help me in resolving this issue?

Thanks in advance…

In most programming languages, comparison operator is == while = is for assignment.

Thanks Stephane, post giving == i am able to compile my script