Why is Visual Studio Code not highlighting my nested multi-line JavaScript comment as I anticipated?

/*/*! what is the reason */
for this annotation*/

Can someone explain why the annotation is not working as expected in this scenario? I've already verified it in VS code.

Answer №1

In JavaScript, the absence of nestable multiline comments is a notable constraint (similar to many other programming languages: Why, in general, are nested block comments NOT allowed?). For detailed information on this aspect, you can refer to the language specification available at . It's important to note that when dealing with multiline comments, the opening "/*" signifies the beginning of the comment and the closing "*/" marks the end. Any additional content after the closing tag, such as "annotation*/", would be considered outside of the comment and will result in invalid syntax.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The jQuery closest selector seems to be malfunctioning when trying to scroll and focus on a specific class

My HTML code snippet is as follows: <div class="main"> <div class="sub-1"> <select> <option>1</option> <option>2</option> </select> </div> <div class="sub-2"> ...

What is the best method for transmitting server errors to the client?

When using passport.js, I have all the required code in place. However, I am facing an issue with displaying errors on the client-side. Despite having the successRedirect set up correctly, nothing happens when a wrong password is entered, and no error mess ...

Redux saga will halt all other effects if one fails during execution

Having some trouble with yield all in saga effect, I've included a snippet of my code below function* fetchData(item) { try { const data = yield call(request, url); yield put(fetchDataSuccess(data)); } catch (error) { yield put(fetchDa ...

Attempting to toggle variable to true upon click, but encountering unexpected behavior

On my webpage, I have implemented a simple tab system that is only displayed when the variable disable_function is set to false. However, I am facing an issue with setting disable_function to true at the end of the page using a trigger. When this trigger ...

Listening for keypress events on a div element using React

I'm currently struggling with implementing a keypress listener on a component. My goal is to have my listener activated whenever the "ESC" key is pressed, but I can't seem to figure it out. The function component I am working with is quite stra ...

Fetch operates based on the specified categoryId

Hey there, I'm currently in the process of learning JS and trying to fetch data from an API. I've successfully fetched all the work from api/works and displayed them in a div. Now, I'm looking to create 3 buttons that represent 3 categories ...

Only grant access to Angular view if user possesses the necessary cookie

How can I restrict access to a view in angular ui-router only if a cookie is active with the user's email address? I am currently setting the cookie in a post request where I assign the cookie value to the user's email address. Now, I want to e ...

What is the best way to achieve this particular grid layout using html and css?

I have a CSS grid of icons and I am trying to create a divider between each cell that fades in opacity towards the edges, similar to an airbrush effect. However, I want the cells themselves to remain transparent so that the background pattern is still visi ...

Interactive Animation featuring Interactive Pop-up Boxes

I am facing an issue with the 'zoomIn' animation where the background: rgba(0, 0, 0, 0.5); is not present when the popup box appears. I want the background to be there from the start of the animation. Additionally, after clicking the Submit butt ...

Error: The reduce function cannot be applied to $scope.array as it is not a

I am currently facing an issue with a section of my code that involves loading attributes related to a page using drop-down lists. These attributes, namely instruments, style, and scoring, are fetched through a service call. For instance, when retrieving ...

Waiting for the response to come by subscribing in Angular

I am encountering an issue while trying to subscribe to an Observable and assign data from the response. The problem is that my code does not wait for the response before executing the console.log(this.newIds) line, resulting in an empty value being logg ...

Issues arising during the initialization of Tinymce

After setting the editor on the frontend, I encountered an issue with initializing tinymce. Here is my code: <head> <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> </head> <body> <a class=pageedit>Edit< ...

Angular-ui typeahead feature allows users to search through a predefined

I recently developed a typeahead feature using the angular-ui library. Here is the current HTML for my typeahead: <input name="customers" id="customers" type="text" placeholder="enter a customer" ng-model="selectedCustomer" uib-typeahead="customer.fir ...

Retrieve the final non-null element within each collection

const totalItems = $('.item').length; $.each(JSON.parse(json), function(index, object) { const itemId = object.itemId; if (itemId !== null && index !== totalItems - 1){ const temp = &apo ...

Display div content depending on the clicked ID in AngularJS

Unique Header Links HTML <ul ng-controller="pageRouteCtrl"> <li ui-sref-active="active"> <a ui-sref="home" class="" ng-click="getPageId('live-view')">LIVE</a> </li> <li> <a ng-clic ...

AngularJS Javascript calendar for selecting dates

I have developed a calendar that displays the current month and the next 12 months, along with the current date to the last date of the current month. For example, if today is October 20th, it will display dates from October 20th to October 31st. However, ...

Unlocking the Secret: Retrieving Click Event Values from a jQuery Function

Is there a way to retrieve the onclick event value change in jQuery when clicking on a DIV? $("ul li").click(function(){ var newValue = $(this).val(); }); $(function(){ alert(newValue); }); ...

Generating a JSON Array Made up of JSON Elements Using JQuery

Currently, my goal is to send a JSON Object to the backend. Essentially, I aim to retrieve the input from 2 textfields and a list of all selected checkboxes. Below is an excerpt of my JavaScript code: function insertNewHero() { var selectedAbiliti ...

Leveraging chrome.tabs.executeScript for populating various select options in multi-select fields

Despite my efforts to find a solution on similar posts, I am still struggling to find the specific answer I need. I am currently developing a simple chrome extension that aims to streamline the process of filling out a large form with static information. ...

JavaScript code that uses jQuery does not function properly on an HTML form

Hello everyone, I am having trouble with some JavaScript code. Here is what I have: $(document).ready(function(){ $(".replyLink").click(function(){ $("#form-to-"+this.id).html(htmlForm()).toggle(500); return false; }); function htmlForm(){ var htm ...