Blog o programowaniu, błędach w kodzie, debugowaniu i refaktoryzacji

// Dev notes

function deploySafely()

if (isFriday()) {

console.warn(„Do not touch production.”);

return;

}

deploy();

}

Notatki programistki

Kod jest jak dowcip. Jeśli musisz go wyjaśniać, jest kiepski


Praktyczny kod

Pigułka wiedzy

Level Up Your Arrays with .map()

You can use .map() to instantly transform every item in an array into something new — without mutating the original one.

const labels = numbers.map(n => `Item: ${n}`);

.map() always returns a new array, making transformations clean and predictable.

Recovering a Deleted Git Branch

Did you know you can recover a deleted Git branch?

If you accidentally deleted a local branch, you can bring it back!

git reflog

Find the commit hash where your branch last pointed, then run:

git checkout -b <branch-name> <commit-hash>

Tip: git reflog keeps a record of all recent branch movements – even deleted ones!

GIT: See who changed a specific line

Want to know who last modified a line in a file?

git blame <file>

Perfect for tracking down when and why a change was made.

Blog

Najnowsze posty

Kategoria

JavaScript

Kategoria

Narzędzia Front-end Developera

Kategoria

Linux

Kategoria

CSS