Но что делать, если элементов много?
const arr = [1,2,3,4,5,6,7,8,9,10];
arr.forEach((value, index) => {
window[`elem_${index}`] = value;
})
console.log(elem_1); // 1
console.log(elem_2); // 2
- a9.forEach(function(elem) {
- elem.toLowerCase();
- });
-
- return a9;
+ return a9.map(function (elem) {
+ return elem.toLowerCase();
+ });
- a9.forEach(function(elem) {
- elem.toLowerCase();
- });
+ a9.forEach(function(elem, i, arr) {
+ arr[i] = elem.toLowerCase();
+ });
- a9.forEach(function(elem) {
- elem.toLowerCase();
- });
+ for (let index = 0; index < a9.length; index++) {
+ a9[index] = a9[index].toLowerCase();
+ }
const lastDigit = 765 % 10; // -> 5
font-family: Gilroy
@font-face {
font-family: "OpenSans";
src: url("fonts/opensans.woff2") format("woff2"),
url("fonts/opensans.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "OpenSans";
src: url("fonts/opensansbold.woff2") format("woff2"),
url("fonts/opensansbold.woff") format("woff");
font-weight: 700;
font-style: normal;
font-display: swap;
}
git diff
, которая выводит изменения в файлах, которые еще не были добавлены в индекс. Сравнение происходит с последним коммитом. Часть правок противоречат основному тз, как поступить?Все что противоречит основному ТЗ оплачивается отдельно, и о сроках и возможности таких правок тоже договариваются отдельно.
class DbConnection
{
private string $userName;
private string $password;
private string $dbname;
public function __construct(string $userName, string $password, string $dbName)
{
$this->userName = $userName;
$this->password = $password;
$this->dbname = $dbName;
}
}
class AuthController
{
private DbConnection $dbConnection;
public function __construct(DbConnection $connection)
{
$this->dbConnection = $connection;
}
}
$dbSettings = include('dbconfig.php');
$connection = new DbConnection($dbSettings['login'], $dbSettings['password'], $dbSettings['dbName'] );
$controller = new AuthController($connection);
return [
'login'=>'myLogin',
'password'=>'myPassword',
'dbName'=>'myDbName'
];