PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label notation. Show all posts
Showing posts with label notation. Show all posts

Tuesday, December 13, 2022

[FIXED] What is `^` in Visual Studio Code key bindings notation

 December 13, 2022     key-bindings, notation, shortcut, syntax, visual-studio-code     No comments   

Issue

I'd like to open Source Control with a keyboard shortcut.

From the tooltip I can see, that a shortcut exists: tooltip shows the shortcut (^ shift G)

My problem: How do I type the caret character? On my keyboard it's (shift + 6). However this does not work for shortcuts.


Solution

In some environments ^ stands for the Control key. Visual Studio Code uses that notation on its MacOS version.

macOS Linux
Integrated terminal Integrated terminal


Answered By - Álvaro González
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

[FIXED] What is "?:" notation in JavaScript?

 December 13, 2022     coding-style, javascript, notation, operators, syntax     No comments   

Issue

I found this snippet of code in my travels in researching JSON:

var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;

I'm seeing more and more of the ? and : notation. I don't even know what it is called to look it up! Can anyone point me to a good resource for this? (btw, I know what != means).


Solution

It's called a Conditional (ternary) Operator. It's essentially a condensed if-else.

So this:

var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;

...is the same as this:

var array;
if (typeof objArray != 'object') {
    array = JSON.parse(objArray);
} else {
    array = objArray;
}


Answered By - Matt Huggins
Answer Checked By - Mildred Charles (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing