--- id: 56533eb9ac21ba0edf2244b8 title: Concatenating Strings with the Plus Equals Operator challengeType: 1 videoUrl: '' localeTitle: سلاسل متسلسلة مع Plus Equals Operator --- ## Description
يمكننا أيضًا استخدام += operator لسَلسَلة سلسلة في نهاية متغير سلسلة موجود. يمكن أن يكون هذا مفيدًا جدًا لكسر سلسلة طويلة عبر عدة أسطر. ملحوظة
احترس من المساحات. لا يضيف Concatenation فراغات بين السلاسل المتسلسلة ، لذا ستحتاج إلى إضافتها بنفسك.
## Instructions
إنشاء myStr عبر عدة سطور عن طريق وصل هاتين السلسلتين: "This is the first sentence. " و "This is the second sentence." باستخدام += عامل التشغيل. استخدم += عامل مشابه لكيفية ظهوره في المحرر. ابدأ بتخصيص السلسلة الأولى إلى myStr ، ثم أضفها في السلسلة الثانية.
## Tests
```yml tests: - text: يجب أن يكون لـ myStr قيمة This is the first sentence. This is the second sentence. testString: 'assert(myStr === "This is the first sentence. This is the second sentence.", "myStr should have a value of This is the first sentence. This is the second sentence.");' - text: استخدم += عامل لبناء myStr testString: 'assert(code.match(/\w\s*\+=\s*[""]/g).length > 1 && code.match(/\w\s*\=\s*[""]/g).length > 1, "Use the += operator to build myStr");' ```
## Challenge Seed
```js // Example var ourStr = "I come first. "; ourStr += "I come second."; // Only change code below this line var myStr; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```