Tag: CONSTRUCTOR-CHAINING
Estoy tratando de obtener el resultado de búsqueda para mostrarlo en mi página html y eventualmente en un formulario. El problema es mi función .map, cuando ejecuto el código solo puedo ver el registro que estoy buscando en la consola. ¿Alguna sugerencia? Estoy usando nodejs, express y html. javascript //Obtener . . . Read more
Entonces tengo una lista que almacena nombres con un nombre de pila y un apellido (esta lista se llama regst). Y ya tengo algunos métodos que separan el nombre de pila y el apellido y también un método set y get. Tengo que ejecutar un código que devuelva una cadena . . . Read more
En Dart, se pueden utilizar las instrucciones de cambio (switch) en lugar de un largo if-then-else. var command = ‘OPEN’; switch (command) { case ‘CLOSED’: executeClosed(); break; case ‘OPEN’: executeOpen(); break; default: executeUnknown(); } Pero a veces solo queremos proporcionar un valor basado en una condición. Por ejemplo, dentro de . . . Read more
Quiero agregar un manejador http condicionalmente, basado en cierta condición. func ConditionalCheck(arg string) func(http.Handler) http.Handler { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() check, ok := ctx.Value(“specific”).(bool) if check { SpecificCheck(arg) } else { next.ServeHTTP(w, r) } }) } } func SpecificCheck(arg string) . . . Read more