---
title: "Discussion on \"The JavaScript substitution for IF with AND (&&) operator\" | Hashnode"
description: "Discussion on \"The JavaScript substitution for IF with AND (&&) operator\". The && operator unique to JavaScript.With it you can quickly go from this\nfunction visitSite(user) {\n    if (user.isLoggodIn) {\n        console.log(`You are $ {user.name}`) \n    }\n    console.log (“Welcome”);\n}\n\nTo this:\nfunction visitSite(user) {\n  ..."
url: "https://hashnode.com/posts/the-javascript-substitution-for-if-with-and-operator/669d02e0d9f211b6bddf0340"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The JavaScript substitution for IF with AND (&&) operator](https://ligalahhezron.hashnode.dev/the-javascript-substitution-for-if-with-and-operator?utm_source=hashnode&utm_medium=feed)

The && operator unique to JavaScript.With it you can quickly go from this function visitSite(user) { if (user.isLoggodIn) { console.log(\`You are $ {user.name}\`) } console.log (“Welcome”); } To this: function visitSite(user) { ...

Jul 21, 2024 · 1 min read · ligalahhezron.hashnode.dev  
Read the article

## Written by

[Ligalah Hezron](https://hashnode.com/@Ligalah)

@Ligalah · Kenya

  
[View profile](https://hashnode.com/@Ligalah)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
