O que é "…" em JavaScript?

Estou estudando alguns algoritmos em JavaScript, mas estou com dúvida no seguinte código:

const newArray = [...arr2];

arr2 é uma array qualquer composta por números, por exemplo, arr2 = [1, 2, 3].

Gostaria de entender o que significa essa parte [...arr2] em específico.

nginx: [emerg] unexpected "}" in conf

Hello,
Can someone point out the unexpected brace please in my conf file?


server {
    server_name mydomain.com www.mydomain.com;
    root /var/www/mydomain.com/public_html;
    listen 80;
   
    access_log /var/log/nginx/mydomain.com-access.log;
    error_log /var/log/nginx/mydomain.com-error.log;
   
    location / {
       
        index index.html index.htm
    }    

    location / {
        try_files  $uri $uri/ /index.php?$args;
    }

    location ~*...
Code (markup):

nginx: (emerg) unexpected "}" in conf

selectores css "~" no selecciona valores desde el principio

Buen dia, tengo una lista de elementos "<li>" creada con datos que saco de una database. Es algo así:

(.....MÁS.....)

var html ='';
variable.forEach(function(e){

(.....MÁS.....)

            if(emisor == mail){
              var classs = "mensajeder";
              var li = "d-flex flex-row-reverse djk";
            }else{
              var classs = "mensajeizq";
              var li = "d-flex flex-row ljk";
            }

(.....MÁS.....)

html +=`<li class="`+li+`" id="`+key+`">
          <div class="`+classs+`  d-flex ">
             <div class="menpp">`+mensaje+`</div>
          </div>
          <div class="mensll `+key+`">&nbsp;`+hora+`&nbsp;&nbsp;</div>
        </li>`;

(.....MÁS.....)

});

(.....MÁS.....)

y luego el css que le agregé para probar su funcionamiento es:

.djk~.ljk{
        border:1px solid black;
}

.ljk~.djk{
        border:1px solid blue;
}

Sin embargo el resultado es que con los primeros "<li>" (ya sea de una u otra forma) no sucede nada… y no entiendo porqué ¿Alguien sabe como solucionarlo?

private $query = ""; –> syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION…

Hello dear MySQL developers, i am mere user and i want to ask you if you can please let me know what is wrong in the file backend/mysql.class.php

I am asking because the script i have uploaded says this:

Line 23 is:…

private $query = ""; –> syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION…

r – What does the operator "~" mean in a tidyverse context?

Assume the following record:

df_1 <- structure(list(var_1 = c(42.0324095338583, 86.828490421176, 42.4499513395131, 
87.8373390808702, 69.4962524808943), var_2 = c(52.6775231584907, 
60.7429852150381, 23.1536079756916, 89.0404256992042, 40.8967914432287
), var_3 = c(53.2254045270383, 99.7671523876488, 55.2181884087622, 
97.3904117196798, 63.9911676943302), var_4 = c(77.9183112829924, 
53.8156733289361, 71.4701929315925, 70.3330857120454, 24.3069419451058
), var_5 = c(48.498358130455, 86.109549254179, 45.0998894125223, 
61.7115858010948, 39.3580442667007), var_6 = c(43.4050587192178, 
32.7955435216427, 46.6158176586032, 43.4641770273447, 49.2192720063031
), groups = structure(c(1L, 2L, 2L, 2L, 2L), .Label = c("1", 
"2", "3"), class = "factor")), row.names = c(NA, 5L), class = "data.frame")

And the following function:

library(tidyverse)
library(magrittr)

df_1 %>% 
  filter(
    across(.cols = is.numeric, .fns = ~ is_weakly_greater_than(e1 = ., e2 = 40))
  )

#     var_1    var_2    var_3    var_4    var_5    var_6 groups
#1 42.03241 52.67752 53.22540 77.91831 48.49836 43.40506      1
#2 87.83734 89.04043 97.39041 70.33309 61.71159 43.46418      2

It works normally. But just take the operator ~::

df_1 %>% 
  filter(
    across(.cols = is.numeric, .fns = is_weakly_greater_than(e1 = ., e2 = 40))
  )

Error: across() may only be used in dplyr verbs.

  • What it means to use the operator ~ within the codes of tidyverse?

Failed to update inventory REST API? if the SKU contains a "#"

I am trying to update the inventory of our products from our ERP using the rest of the API. I ran into a problem if the SKU contains a pound "#".

A URL like:

https://magento.xyx.com/rest/V1/products/3736924F5/stockItems/1

works fine, but a URL from:

https://magento.xyx.com/rest/V1/products/3736924F5#M/stockItems/1

Returns the error:

(
(message) => "% fieldName" is required. Enter and try again.
(Parameter) => stdClass object
(
(Field name) => product
)

)

I tried encoding the SKU via URL but it didn't work. Any ideas?