This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = getDataFromDatabase(); | |
echo json_encode($data); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printMatrix (matrix) { | |
for (let i = 0; i < matrix.length; i++) { | |
const line = matrix[i]; | |
for (let i = 0; i < line.length; i++) { | |
const element = line[i]; | |
console.log(element); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printMatrix (matrix) { | |
for (var i = 0; i < matrix.length; i++) { | |
var line = matrix[i]; | |
for (var i = 0; i < line.length; i++) { | |
var element = line[i]; | |
console.log(element); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file1.js | |
var C = 5; | |
function printConstant () { | |
console.log('Constant value is ', C); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processArray (array) { | |
for(var i = 0; i < array.length; i++) { | |
console.log('Element ', array[i]); | |
} | |
console.log('I can use variable i outside the loop ', i); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Example () { | |
public void processArray (String[] array) { | |
for(int i = 0; i < array.length; i++) { | |
System.out.println(array[i]); | |
} | |
System.out.println("I cannot use the variable i here"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { x = 0, y = 0 } = getPosition(); | |
console.log('POSITION (x, y) = ', x, y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { x, y } = getPosition(); | |
console.log('POSITION (x, y) = ', x, y); |