DEV Community

Reza Lavarian profile picture

Reza Lavarian

Hey 👋 I'm a software engineer, an author, and an open-source contributor. I enjoy helping people (including myself) decode the complex side of technology.

JavaScript list (array) comprehension explained with examples

JavaScript list (array) comprehension explained with examples

3
Comments
4 min read

Want to connect with Reza Lavarian?

Create an account to connect with Reza Lavarian. You can also sign in below to proceed if you already have an account.

Already have an account? Sign in
How to fix “ValueError: I/O operation on closed file” in Python

How to fix “ValueError: I/O operation on closed file” in Python

1
Comments
3 min read
Four ways to check if a variable is a string in JavaScript (with examples)

Four ways to check if a variable is a string in JavaScript (with examples)

4
Comments
4 min read
Python __new__() method explained with examples

Python __new__() method explained with examples

3
Comments
4 min read
Label htmlFor Property Explained

Label htmlFor Property Explained

2
Comments
3 min read
About “ReferenceError: document is not defined” in JavaScript

About “ReferenceError: document is not defined” in JavaScript

6
Comments
4 min read
About "SyntaxError: Unexpected end of JSON input" in JavaScript

About "SyntaxError: Unexpected end of JSON input" in JavaScript

6
Comments
2 min read
Add commas to numbers in JavaScript (Explained with examples)

Add commas to numbers in JavaScript (Explained with examples)

7
Comments
3 min read
How to remove the last character from a string in PHP

How to remove the last character from a string in PHP

3
Comments
4 min read
About "TypeError: map is not a function" in JavaScript

About "TypeError: map is not a function" in JavaScript

15
Comments 1
5 min read
Cannot find module error in Node.js (Fixed)

Cannot find module error in Node.js (Fixed)

23
Comments
6 min read
PHP double question marks (Null coalescing operator) explained

PHP double question marks (Null coalescing operator) explained

5
Comments
2 min read
How to Flatten an array in PHP (four methods)

How to Flatten an array in PHP (four methods)

7
Comments 1
4 min read
PHP replace space with dash explained with examples

PHP replace space with dash explained with examples

1
Comments
3 min read
Integer division in JavaScript explained

Integer division in JavaScript explained

4
Comments 3
3 min read
JavaScript isset Equivalent (3 methods)

JavaScript isset Equivalent (3 methods)

2
Comments
5 min read
How to check if an element exists in JavaScript (with examples)

How to check if an element exists in JavaScript (with examples)

14
Comments 1
3 min read
Get viewport width and height in JavaScript (with examples)

Get viewport width and height in JavaScript (with examples)

8
Comments 1
2 min read
About “__dirname is not defined in ES module scope” in JavaScript

About “__dirname is not defined in ES module scope” in JavaScript

2
Comments 1
2 min read
How to get yesterday’s date in JavaScript without a library

How to get yesterday’s date in JavaScript without a library

3
Comments 1
2 min read
How to add days to a date in JavaScript (without a library)

How to add days to a date in JavaScript (without a library)

3
Comments 1
3 min read
Subtract days from a date in JavaScript without a library

Subtract days from a date in JavaScript without a library

3
Comments 1
3 min read
Get the day of the week in JavaScript without a library

Get the day of the week in JavaScript without a library

5
Comments 1
3 min read
JavaScript double exclamation mark explained (with examples)

JavaScript double exclamation mark explained (with examples)

8
Comments 1
4 min read
Javascript if/else shorthand explained (with common uses cases)

Javascript if/else shorthand explained (with common uses cases)

5
Comments
2 min read
About "Cannot use import statement outside a module" in JavaScript

About "Cannot use import statement outside a module" in JavaScript

2
Comments
3 min read
About "‘str’ object has no attribute ‘decode’" error in Python

About "‘str’ object has no attribute ‘decode’" error in Python

4
Comments
2 min read
About "getElementById is not a function" in JavaScript

About "getElementById is not a function" in JavaScript

3
Comments
3 min read
Convert a dd/mm/yyyy string to a Date object in JavaScript

Convert a dd/mm/yyyy string to a Date object in JavaScript

10
Comments
4 min read
About "Await is only valid in Async functions" error in JavaScript

About "Await is only valid in Async functions" error in JavaScript

4
Comments 1
5 min read
About "AttributeError module ‘DateTime’ has no attribute ‘strptime’" in Python

About "AttributeError module ‘DateTime’ has no attribute ‘strptime’" in Python

10
Comments 1
2 min read
About "Unindent does not match any outer indentation level" error in Python

About "Unindent does not match any outer indentation level" error in Python

1
Comments
5 min read
About "missing 1 required positional argument: ‘self’" in Python

About "missing 1 required positional argument: ‘self’" in Python

65
Comments
3 min read
How to reverse a range in Python (with examples)

How to reverse a range in Python (with examples)

2
Comments
3 min read
About "TypeError: unhashable type: ‘dict'” in Python

About "TypeError: unhashable type: ‘dict'” in Python

1
Comments
4 min read
On "TabError: inconsistent use of tabs and spaces in indentation" in Python

On "TabError: inconsistent use of tabs and spaces in indentation" in Python

9
Comments
3 min read
About "Not all arguments converted during string formatting" error in Python

About "Not all arguments converted during string formatting" error in Python

2
Comments
4 min read
About "can only concatenate str (not “list”) to str" in Python

About "can only concatenate str (not “list”) to str" in Python

2
Comments
4 min read
How to fix "can only concatenate str (not “dict”) to str" in Python

How to fix "can only concatenate str (not “dict”) to str" in Python

2
Comments
4 min read
How to fix "can only concatenate str (not “bool”) to str" in Python

How to fix "can only concatenate str (not “bool”) to str" in Python

1
Comments
3 min read
How to fix "can only concatenate str (not “int”) to str" in Python

How to fix "can only concatenate str (not “int”) to str" in Python

1
Comments
4 min read
About 'can only concatenate str (not “float”) to str' error in Python

About 'can only concatenate str (not “float”) to str' error in Python

1
Comments 1
4 min read
How to fix “TypeError: ‘float’ object is not callable” in Python

How to fix “TypeError: ‘float’ object is not callable” in Python

1
Comments
5 min read
How to fix "‘dict’ object is not callable" in Python

How to fix "‘dict’ object is not callable" in Python

4
Comments
5 min read
How to fix "‘tuple’ object is not callable" in Python

How to fix "‘tuple’ object is not callable" in Python

2
Comments
6 min read
How to fix "‘bool’ object is not callable" in Python

How to fix "‘bool’ object is not callable" in Python

3
Comments
5 min read
How to fix "SyntaxError: invalid decimal literal" in Python

How to fix "SyntaxError: invalid decimal literal" in Python

5
Comments
3 min read
How to fix "SyntaxError: ‘break’ outside loop" in Python

How to fix "SyntaxError: ‘break’ outside loop" in Python

12
Comments
3 min read
How to fix "SyntaxError: ‘continue’ not properly in loop" in Python

How to fix "SyntaxError: ‘continue’ not properly in loop" in Python

2
Comments
3 min read
How to fix "SyntaxError: cannot assign to function call here" in Python

How to fix "SyntaxError: cannot assign to function call here" in Python

2
Comments
3 min read
How to fix "SyntaxError: cannot assign to literal here" in Python

How to fix "SyntaxError: cannot assign to literal here" in Python

1
Comments
3 min read
How to fix "SyntaxError: cannot assign to expression here" in Python

How to fix "SyntaxError: cannot assign to expression here" in Python

2
Comments
4 min read
How to fix "SyntaxError: EOL while scanning string literal" in Python

How to fix "SyntaxError: EOL while scanning string literal" in Python

1
Comments
5 min read
How to fix "SyntaxError: unterminated string literal" in Python

How to fix "SyntaxError: unterminated string literal" in Python

2
Comments
5 min read
How to fix "SyntaxError: invalid character" in Python

How to fix "SyntaxError: invalid character" in Python

3
Comments
3 min read
how to fix "SyntaxError: invalid non-printable character" in Python

how to fix "SyntaxError: invalid non-printable character" in Python

2
Comments
3 min read
How to fix "SyntaxError: Missing parentheses in call to ‘print’" in Python

How to fix "SyntaxError: Missing parentheses in call to ‘print’" in Python

30
Comments
2 min read
How to fix "SyntaxError: positional argument follows keyword argument" in Python

How to fix "SyntaxError: positional argument follows keyword argument" in Python

30
Comments
4 min read
[Solved] SyntaxError: ‘return’ outside function in Python

[Solved] SyntaxError: ‘return’ outside function in Python

2
Comments
3 min read
How to fix SyntaxError: unterminated triple-quoted string literal in Python

How to fix SyntaxError: unterminated triple-quoted string literal in Python

3
Comments
3 min read
loading...