P
P
Peacefulwarriorr2020-03-24 13:11:17
JavaScript
Peacefulwarriorr, 2020-03-24 13:11:17

What extension for Visual studio code is responsible for auto-completion of tags?

I'm a beginner, I learned to write markup in sublime text 3 and it's very convenient when you just start writing a tag, it not only closes it automatically, but also inserts attributes, for example, for the < a > tag, it immediately inserted href. In VS Code, I found only the maximum automatic exposure of the closing tag. Can you please suggest an extension or setting to make it work in VS code as well.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
0
0xD34F, 2019-08-30
@nak-alexey

array1.filter(n => !array2.find(m => m.name === n.name))

Well, in order to find the opposite, what is in 2 and not in 1 - you need to change their places.

S
Sergey c0re, 2019-08-30
@erge

Variant of @pterodaktil

let merged = [...array1, ...array2].map(i => i.name);

if (new Set(merged).size === merged.length/2) {
  // равны
} else {
  // не равны
}

Also, if the objects are more complex-structured, but have a strict order in the structure, then you can try this
if (JSON.stringify(obj1) === JSON.stringify(obj2)) {
  // равны
} else {
  // не равны
}

A
Anton Skiba, 2019-08-30
@SkibaAnton

It is important to understand what kind of differences you are interested in? You can write a whole function with a bunch of checks for array lengths, object structure, object order, so it's not clear what exactly you want to get. If it's just equality, then the easiest way to convert them to strings is with JSON.stringify

function isEqual(arr1, arr2) {
  return JSON.stringify(arr1) === JSON.stringify(arr2);
}

But this method does various implicit tricks with nested objects and functions in objects

A
approximate solution, 2020-03-24
@approximate_solution

Read emmet's doc. You can do amazing things with it to help automate your routine.
https://code.visualstudio.com/docs/editor/emmet

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question