Skip to content

Instantly share code, notes, and snippets.

View tonicastillo's full-sized avatar

Toni Castillo tonicastillo

View GitHub Profile
@tonicastillo
tonicastillo / Provincias Ciudades de España con posición cordenadas GPS.json
Last active February 16, 2023 08:59
[DATA: Provincias de españa] Provincias/Ciudades de España con posición cordenadas GPS.json (fuente http://www.sitiosespana.com/paginas/coordenadas.htm )
[
{
"prov": "Alava",
"loc": "Amurrio",
"lat": 43.03,
"lng": 3
},
{
"prov": "Alava",
"loc": "Laguardia",
@tonicastillo
tonicastillo / JS Array CheasSheet.md
Last active February 16, 2023 12:18
[JS Array CheatSheet] #CheatSheet

Array.map()

Returns a new array with the results of calling a provided function on every element in this array.
const list = [😫, 😫, 😫, 😫];
list.map((⚪️) => 😀); // [😀, 😀, 😀, 😀]

// Code
const list = [1, 2, 3, 4];

list.map((el) => el * 2); // [2, 4, 6, 8]

@tonicastillo
tonicastillo / REACT JS Context.js
Last active February 22, 2023 10:48
[REACT Context] #React
//Context.js
import React, { createContext, useState, ... } from "react"
export const MyContext = createContext()
const MyContextProvider = ({children}) => {
...
//Aquí se manejan u obtienen los datos
...
return(
<MyContext.Provider