Skip to content

Instantly share code, notes, and snippets.

@Ruffo324
Created September 11, 2021 18:42
Show Gist options
  • Save Ruffo324/531522156d2cc1928719bd95bd9a4814 to your computer and use it in GitHub Desktop.
Save Ruffo324/531522156d2cc1928719bd95bd9a4814 to your computer and use it in GitHub Desktop.
automatic numeric photo renaiming
data = ["Jahreszeit_Bild_2021_01.jpg"]
Jetzt brauche ich eine Funktion, die die ID also die 01 eins hochsetzt wenn ich ein neues Bild hinzufüge. Und dementsprechend bei dem nächsten dann die 02 eins weiter hoch setzt
data = ["Jahreszeit_Bild_2021_01.jpg"]
function setzeIdHoch(filename){
data.forEach(value =>{
// Vergleiche valueId mit filenameId
data.push(filenameMitNeuerId)
})
}
// Danach
data = ["Jahreszeit_Bild_2021_01.jpg", "Jahreszeit_Bild_2021_02.jpg"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment